From 446234170ad08661dafb504933733791b7d4c4bd Mon Sep 17 00:00:00 2001 From: Nasser Anssari Date: Sun, 19 Jan 2025 14:46:04 +0300 Subject: [PATCH 01/16] feat: support activities (#43) --- .../change-builder-method-param-type.yaml | 8 + .../change-class-param-type.yaml | 11 + .../change-builder-method-param-type.yaml | 8 + .../change-class-param-type.yaml | 11 + .../resources/post-processor/src/index.ts | 8 + ...ctivities-cancellation-policy-processor.ts | 32 + .../available-time-slot-processor.ts | 32 + specs/openapi-merge.json | 6 + specs/xap-activity.specs.yaml | 1335 +++++++++++++++++ 9 files changed, 1451 insertions(+) create mode 100644 customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-builder-method-param-type.yaml create mode 100644 customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-class-param-type.yaml create mode 100644 customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-builder-method-param-type.yaml create mode 100644 customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-class-param-type.yaml create mode 100644 customizations/generator/openapi/src/main/resources/post-processor/src/processors/activities-cancellation-policy-processor.ts create mode 100644 customizations/generator/openapi/src/main/resources/post-processor/src/processors/available-time-slot-processor.ts create mode 100644 specs/xap-activity.specs.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-builder-method-param-type.yaml b/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-builder-method-param-type.yaml new file mode 100644 index 00000000..9196a5d5 --- /dev/null +++ b/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-builder-method-param-type.yaml @@ -0,0 +1,8 @@ +rule: + kind: user_type + inside: + kind: parameter + regex: freeCancellationEndDateTime + stopBy: + kind: class_declaration + regex: Builder diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-class-param-type.yaml b/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-class-param-type.yaml new file mode 100644 index 00000000..8aa1ed89 --- /dev/null +++ b/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-class-param-type.yaml @@ -0,0 +1,11 @@ +rule: + kind: user_type + pattern: $TYPE + inside: + any: + - kind: class_parameter + regex: freeCancellationEndDateTime + - kind: nullable_type + inside: + kind: class_parameter + regex: freeCancellationEndDateTime diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-builder-method-param-type.yaml b/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-builder-method-param-type.yaml new file mode 100644 index 00000000..508fadcd --- /dev/null +++ b/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-builder-method-param-type.yaml @@ -0,0 +1,8 @@ +rule: + kind: user_type + inside: + kind: parameter + regex: dateTime + stopBy: + kind: class_declaration + regex: Builder diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-class-param-type.yaml b/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-class-param-type.yaml new file mode 100644 index 00000000..63cfebce --- /dev/null +++ b/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-class-param-type.yaml @@ -0,0 +1,11 @@ +rule: + kind: user_type + pattern: $TYPE + inside: + any: + - kind: class_parameter + regex: dateTime + - kind: nullable_type + inside: + kind: class_parameter + regex: dateTime diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/index.ts b/customizations/generator/openapi/src/main/resources/post-processor/src/index.ts index e8fa9d14..78e40168 100644 --- a/customizations/generator/openapi/src/main/resources/post-processor/src/index.ts +++ b/customizations/generator/openapi/src/main/resources/post-processor/src/index.ts @@ -5,6 +5,8 @@ import {NonCancellableDateTimeRangeProcessor} from './processors/non-cancellable import {PenaltyRuleProcessor} from './processors/penalty-rule-processor'; import {VendorLocationDetailsProcessor} from './processors/vendor-location-details-processor'; import {GetCarsListingsOperationParamsProcessor} from './processors/get-cars-listings-operation-params-processor'; +import {ActivitiesCancellationPolicyProcessor} from './processors/activities-cancellation-policy-processor'; +import {AvailableTimeSlotProcessor} from './processors/available-time-slot-processor'; import * as path from 'path'; @@ -34,4 +36,10 @@ switch (fileName) { case 'GetCarsListingsOperationParams': new GetCarsListingsOperationParamsProcessor().process(filePath); break; + case 'ActivitiesCancellationPolicy': + new ActivitiesCancellationPolicyProcessor().process(filePath); + break; + case 'AvailableTimeSlot': + new AvailableTimeSlotProcessor().process(filePath); + break; } diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/processors/activities-cancellation-policy-processor.ts b/customizations/generator/openapi/src/main/resources/post-processor/src/processors/activities-cancellation-policy-processor.ts new file mode 100644 index 00000000..0e0e9328 --- /dev/null +++ b/customizations/generator/openapi/src/main/resources/post-processor/src/processors/activities-cancellation-policy-processor.ts @@ -0,0 +1,32 @@ +import {Edit, NapiConfig, SgNode} from '@ast-grep/napi'; +import {Processor} from './processor'; +import {RuleFunction} from './shared.types'; + +export class ActivitiesCancellationPolicyProcessor extends Processor { + rules: RuleFunction[]; + id: String = 'activities-cancellation-policy'; + + constructor() { + super(); + this.rules = [ + this.changeClassParamType, + this.changeBuilderMethodParamType, + ].map(rule => rule.bind(this)); + } + + changeClassParamType(root: SgNode): Edit[] { + const config = this.readRule('change-class-param-type'); + + return root.findAll(config).map(node => { + return node.replace('java.time.LocalDateTime'); + }); + } + + changeBuilderMethodParamType(root: SgNode): Edit[] { + const config = this.readRule('change-builder-method-param-type'); + + return root.findAll(config).map(node => { + return node.replace('java.time.LocalDateTime'); + }); + } +} diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/processors/available-time-slot-processor.ts b/customizations/generator/openapi/src/main/resources/post-processor/src/processors/available-time-slot-processor.ts new file mode 100644 index 00000000..8f023644 --- /dev/null +++ b/customizations/generator/openapi/src/main/resources/post-processor/src/processors/available-time-slot-processor.ts @@ -0,0 +1,32 @@ +import {Edit, NapiConfig, SgNode} from '@ast-grep/napi'; +import {Processor} from './processor'; +import {RuleFunction} from './shared.types'; + +export class AvailableTimeSlotProcessor extends Processor { + rules: RuleFunction[]; + id: String = 'available-time-slot'; + + constructor() { + super(); + this.rules = [ + this.changeClassParamType, + this.changeBuilderMethodParamType, + ].map(rule => rule.bind(this)); + } + + changeClassParamType(root: SgNode): Edit[] { + const config = this.readRule('change-class-param-type'); + + return root.findAll(config).map(node => { + return node.replace('java.time.LocalDateTime'); + }); + } + + changeBuilderMethodParamType(root: SgNode): Edit[] { + const config = this.readRule('change-builder-method-param-type'); + + return root.findAll(config).map(node => { + return node.replace('java.time.LocalDateTime'); + }); + } +} diff --git a/specs/openapi-merge.json b/specs/openapi-merge.json index f33629bc..99d08b07 100644 --- a/specs/openapi-merge.json +++ b/specs/openapi-merge.json @@ -20,6 +20,12 @@ "dispute": { "prefix": "Sdp" } + }, + { + "inputFile": "./xap-activity.specs.yaml", + "dispute": { + "prefix": "Activities" + } } ], "output": "./specs.yaml" diff --git a/specs/xap-activity.specs.yaml b/specs/xap-activity.specs.yaml new file mode 100644 index 00000000..2fe34aff --- /dev/null +++ b/specs/xap-activity.specs.yaml @@ -0,0 +1,1335 @@ +openapi: 3.0.1 +info: + title: EWSActivity Apis specification + description: OpenAPI Spec for EWS Activity APIs + contact: + name: Partner APIs + url: https://confluence.expedia.biz/pages/viewpage.action?pageId=833040081 + email: autobots@expedia.com + version: v3 + x-eg-lifecycle: LIVE + x-eg-tags: ["Partner", "Activities", "EWS", "ActivitySearch", "ActivityDetails", "ActivityLinks"] +servers: + - url: 'https://apim.expedia.com' + description: Production Server +tags: + - name: Activities List + - name: Activities Details +paths: + /activities/listings: + get: + tags: + - Activities List + description: The Activities Search API allows partners to search for Expedia Activity inventory. + operationId: get-activity-listings + parameters: + - name: location + in: query + description: |- + Can be a city name, street address, three-letter IATA Airport Code or a landmark name. + (If the value submitted does not clearly identify a single location the API may returne a disambiguation response that lists possible options) + schema: + type: string + example: shenzhen + - name: geoLocation + in: query + description: |- + The latitude and longitude values identifying the center point of a search radius (circle). + North latitude will be represented by a positive value. South latitude by a negative value. + East longitude will be represented by a positive value. West longitude by a negative value. + The latitude and longitude values are joined together with a comma (,) character. + schema: + type: string + example: 25.070062,-121.538306 + - name: startDate + in: query + description: |- + Start date for the activity window in YYY-MM-DD format. + If an endDate value is supplied there must also be a startDate. + default: currentDate + schema: + type: string + format: date + example: 2021-10-01 + - name: endDate + in: query + description: |- + End date for the activity window in YYY-MM-DD format. + default: "startDate+14" + schema: + type: string + format: date + example: 2021-10-10 + - name: locale + in: query + description: |- + locale is composed of language identifier and region identifier, connected by "_" that specifies the language in which the response will be returned. + example: "fr_FR" refers to French as spoken in France, while "fr_CA" refers to French as spoken in Canada. + For a full list of supported locales please refer to the link at the bottom of the page. + schema: + type: string + example: en_US + - name: links + in: query + description: |- + Comma-separated list to specify the types of HATEAOS links returned in the API Response. + WD (deep link URL to web infosite) + AD (details API query) + explode: false + schema: + type: array + items: + type: string + enum: + - WD + - AD + example: WD + - name: Key + in: header + description: |- + Unique identifier assigned to partner. + Required for all requests. + Obtained from Expedia Account Manager or representative. + required: true + schema: + type: string + example: X99X9X9-99XX-9XX9-X999-99XX99X9X999X + - name: Partner-Transaction-Id + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: BestTravel-123456-798101112 + responses: + '500': + description: |- + Server side error i.e connection timeout while talking to downstream services, downstream returned error. The server responds back with this Http " + + "response code and with the appropriate JSON error response. + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: '#/components/schemas/Errors' + '200': + description: successful + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: '#/components/schemas/ActivityListingsResponse' + example: + TransactionId: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + Count: 1 + Location: shenzhen, gd + StartDate: 2021-08-01 + EndDate: 2021-08-08 + Categories: + - Count: 1 + CategoryName: Cruises & Water Tours + CategoryDisplayName: Cruises & Water Tours + GroupName: Tours + GroupDisplayName: Tours + Activities: + - Id: 166597 + Title: 'Faster Than Skip-the-Line: Vatican, Sistine Chapel & St. + Peter''s Tour' + Description: Enjoy 5 of Seattle's most popular attractions with a multi-ticket booklet that’s valid for 9 consecutive days. This pass is perfect if you want to explore the city on your schedule, craft your own itinerary, and visit the city’s can’t-miss museums and most iconi.. + Media: + - Type: "1" + Size: t + Url: http://a.travel-assets.com/ lxweb/ media-vault/ 166597_m.jpeg? v=104741 + Categories: + - Walking & Bike Tours + Duration: PT3H0M + CancellationPolicy: + FreeCancellation: true + Price: + Category: Adult + TotalRate: + Value: 100 + Currency: USD + ReferencePrice: + Category: Adult + TotalRate: + Value: 110 + Currency: USD + Savings: + percentage: 42 + amount: + Value: "9" + Currency: USD + Redemption: + Type: Voucherless + Locations: + - Address: + Address1: 99 Union St + City: Seattle + PostalCode: "431625" + Province: WA + Country: USA + GeoLocation: + Latitude: "47.60772" + Longitude: -122.33936 + Locations: + - Address: + Address1: 99 Union St + City: Seattle + PostalCode: "431625" + Province: WA + Country: USA + GeoLocation: + Latitude: "47.60772" + Longitude: -122.33936 + Supplier: + Name: City Wonders + RecommendationScore: 90 + ReviewCount: 100 + Links: + WebDetails: + Href: https://www.expedia.com/things-to-do/space-needle-observation-deck-admission.a193678.activity-details?srp=true&location=sea + ApiDetails: + Accept: application/vnd.exp-activity.v3+json + Method: GET + Href: https://apim.expedia.com/activities/details/CgUyMDIzMBIyCgkyMDEzMDQ1OTYSCTIwOTc3MjcwOBoCMjQqCjIwMTctMTEtMTkyCjIwMTctMTEtMjUqAwoBMg + '400': + description: |- + Client side error while providing the request i.e bad / invalid input parameters. The server responds back with " + + "this Http response code and with the appropriate JSON error response. + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: AMBIGUOUS_LOCATION + Description: Multiple search locations found. + LocationKeyword: 99UnionSt + LocationOptions: + - ShortName: Union Grove, Wisconsin, United States of America + Address: Milwaukee (and vicinity), Wisconsin, United States of America + RequestedLocation: 'United States' + Locations: + - Name: Portland (and vicinity) + LocationId: seat001 + TransactionId: cecf62c8-c103-4181-b09d-53c7190d1c48 + '404': + description: No Route matched + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + no Route matched: + value: |- + { + "message": "no Route matched with those values" + } + '429': + description: API rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + API rate limit exceeded: + value: |- + { + "message": "API rate limit exceeded" + } + '401': + description: Unauthorized or Invalid authentication credentials + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + unauthorized: + value: |- + { + "message": "Unauthorized" + } + Invalid authentication credentials: + value: |- + { + "message": "Invalid authentication credentials" + } + '403': + description: cannot consume this service + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + cannot consume this service: + value: |- + { + "message": "You cannot consume this service" + } + '503': + description: name resolution failed + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + name resolution failed: + value: |- + { + "message": "name resolution failed" + } + '504': + description: upstream server is timing out + content: + text/plain: + examples: + upstream server is timing out: + value: The upstream server is timing out + security: + - basicSchema: [] + /activities/details/{offerToken}: + get: + tags: + - Activities Details + description: The Activity Details API provides detailed information about one selected activity. + operationId: get-activity-details + parameters: + - name: offerToken + in: path + description: the offerToken of a activity + required: true + schema: + type: string + example: CgY0NzY2NzgSCjIwMjEtMDUtMDIaCjIwMjEtMDUtMDc + - name: locale + in: query + description: |- + locale is composed of language identifier and region identifier, connected by "_" that specifies the language + in which the response will be returned. + example: "fr_FR" refers to French as spoken in France, while "fr_CA" refers to French as spoken in Canada. + For a full list of supported locales please refer to the link at the bottom of the page. + schema: + type: string + example: en_US + - name: Key + in: header + description: |- + Unique identifier assigned to partner. + Required for all requests. + Obtained from Expedia Account Manager or representative. + required: true + schema: + type: string + example: X99X9X9-99XX-9XX9-X999-99XX99X9X999X + - name: Partner-Transaction-Id + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: BestTravel-123456-798101112 + responses: + '400': + description: |- + Client side error while providing the request i.e bad / invalid input parameters. The server responds back with " + + "this Http response code and with the appropriate JSON error response. + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: INVALID_LINKS + Description: 'Invalid links. Allowed value are:[WS, AD, WD].' + TransactionId: 583b7277-772a-4802-8ac7-bcdf978abbdb + '500': + description: |- + Server side error i.e connection timeout while talking to downstream services, downstream returned error. The server responds back with this Http " + + "response code and with the appropriate JSON error response. + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: '#/components/schemas/Errors' + '200': + description: successful + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: '#/components/schemas/ActivityDetailsResponse' + example: + TransactionId: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + Count: 1 + Location: shenzhen, gd + StartDate: 2021-08-01 + EndDate: 2021-08-08 + Categories: + - Count: 1 + CategoryName: Cruises & Water Tours + CategoryDisplayName: Cruises & Water Tours + GroupName: Tours + GroupDisplayName: Tours + Activities: + - Id: 166597 + Title: 'Faster Than Skip-the-Line: Vatican, Sistine Chapel & St. + Peter''s Tour' + Description: Enjoy 5 of Seattle's most popular attractions with a multi-ticket booklet that’s valid for 9 consecutive days. This pass is perfect if you want to explore the city on your schedule, craft your own itinerary, and visit the city’s can’t-miss museums and most iconi.. + Media: + - Type: "1" + Size: t + Url: http://a.travel-assets.com/ lxweb/ media-vault/ 166597_m.jpeg? v=104741 + Categories: + - Walking & Bike Tours + Duration: PT3H0M + CancellationPolicy: + FreeCancellation: true + Price: + Category: Adult + TotalRate: + Value: 100 + Currency: USD + ReferencePrice: + Category: Adult + TotalRate: + Value: 110 + Currency: USD + Savings: + percentage: 42 + amount: + Value: "9" + Currency: USD + Redemption: + Type: Voucherless + Locations: + - Address: + Address1: 99 Union St + City: Seattle + PostalCode: "431625" + Province: WA + Country: USA + GeoLocation: + Latitude: "47.60772" + Longitude: -122.33936 + Locations: + - Address: + Address1: 99 Union St + City: Seattle + PostalCode: "431625" + Province: WA + Country: USA + GeoLocation: + Latitude: "47.60772" + Longitude: -122.33936 + Supplier: + Name: City Wonders + RecommendationScore: 90 + ReviewCount: 100 + Links: + WebDetails: + Href: https://www.expedia.com/things-to-do/space-needle-observation-deck-admission.a193678.activity-details?srp=true&location=sea + ApiDetails: + Accept: application/vnd.exp-activity.v3+json + Method: GET + Href: https://apim.expedia.com/activities/details/CgUyMDIzMBIyCgkyMDEzMDQ1OTYSCTIwOTc3MjcwOBoCMjQqCjIwMTctMTEtMTkyCjIwMTctMTEtMjUqAwoBMg + '404': + description: No Route matched + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + no Route matched: + value: |- + { + "message": "no Route matched with those values" + } + '429': + description: API rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + API rate limit exceeded: + value: |- + { + "message": "API rate limit exceeded" + } + '401': + description: Unauthorized or Invalid authentication credentials + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + unauthorized: + value: |- + { + "message": "Unauthorized" + } + Invalid authentication credentials: + value: |- + { + "message": "Invalid authentication credentials" + } + '403': + description: cannot consume this service + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + cannot consume this service: + value: |- + { + "message": "You cannot consume this service" + } + '503': + description: name resolution failed + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + name resolution failed: + value: |- + { + "message": "name resolution failed" + } + '504': + description: upstream server is timing out + content: + text/plain: + examples: + upstream server is timing out: + value: The upstream server is timing out + security: + - basicSchema: [] +components: + schemas: + Money: + required: + - Currency + - Value + type: object + properties: + Value: + type: string + description: The value of the element being defined. + example: "21.9" + Currency: + type: string + description: The ISO 4217 Currency Code that the value is expressed in. + example: USD + LocalCurrencyPrice: + $ref: '#/components/schemas/Money' + description: Container for the discount amount. + Price: + required: + - TotalRate + type: object + properties: + Category: + type: string + description: |- + Type of passenger. + Values supported are: + ADULT | SENIOR | CHILD + example: ADULT + TotalRate: + $ref: '#/components/schemas/Money' + TotalFees: + $ref: '#/components/schemas/Money' + TotalTaxesAndFees: + $ref: '#/components/schemas/Money' + ReferencePrice: + $ref: '#/components/schemas/ReferencePrice' + Savings: + $ref: '#/components/schemas/Savings' + description: The price of the offer + ReferencePrice: + required: + - TotalRate + type: object + properties: + TotalRate: + $ref: '#/components/schemas/Money' + TotalFees: + $ref: '#/components/schemas/Money' + TotalTaxesAndFees: + $ref: '#/components/schemas/Money' + description: Container for the reference price used for strike out display. + Restrictions: + required: + - Max + - Min + - Type + type: object + properties: + Type: + type: string + description: Type of the Restriction. + example: AGE + Max: + type: string + description: Maximum value allowed for the restriction type. + example: "255" + Min: + type: string + description: Minimum value allowed for the restriction type. + example: "9" + Description: + type: string + description: The text to describe the restriction. + example: 9+ years + description: Container of the Restrictions associated to this ticket. + Savings: + required: + - Amount + - Percentage + type: object + properties: + Percentage: + type: integer + description: The percentage of the price that has been discounted off the regular price for the current activity. + format: int32 + example: 10 + Amount: + $ref: '#/components/schemas/Money' + description: Container of savings information. + Ticket: + required: + - Code + - Count + - Id + - TicketPrice + type: object + properties: + Id: + type: integer + description: The numerical identifier for the ticket. + format: int32 + example: 6429 + Code: + type: string + description: |- + The code for the ticket. + Values supported are: + Adult + Traveler + Child + Group + Senior + Infant + Student + example: Adult + Count: + type: integer + description: The number of each ticket type to be booked. + format: int32 + example: 1 + Restrictions: + $ref: '#/components/schemas/Restrictions' + TicketPrice: + $ref: '#/components/schemas/Price' + description: The list of Ticket information. + Address: + type: object + properties: + Address1: + type: string + description: Street Number, Street Name, or PO Box. + example: 724 Pine St + Address2: + type: string + description: Apartment, Floor, Suite, Bldg # or more specific information about Address1. + example: Second Floor + Suite: + type: string + description: Suite/apartment number + example: "123" + City: + type: string + description: The city + example: New York + Province: + type: string + description: The state or province. + example: NY + Country: + type: string + description: 3-letter code for the country. + example: USA + PostalCode: + type: string + description: Zip/postal code. + example: "98004" + description: Address information + Country: + required: + - IsoCode2 + - IsoCode3 + - Name + type: object + properties: + Name: + type: string + description: country name + example: Ireland + Code: + type: string + description: 3-letter code for the country + example: IRL + IsoCode2: + type: string + description: 2-letter code for the country + example: IE + IsoCode3: + type: string + description: 3-letter code for the country + example: IRL + description: Container for disambiguation country information + Error: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Error code describing the issue + example: AMBIGUOUS_LOCATION + DetailCode: + type: string + description: Detailed error code describing the issue. + example: MULTIPLE_AMBIGUOUS_LOCATION + Description: + type: string + description: A simple description of what the error is. + example: 'Multiple pickup locations found. ' + LocationKeyword: + type: string + description: The requested location that caused the error. + example: 'Portland. ' + LocationOptions: + type: array + description: 'List for possible locations from which the customer must choose + the best one to be re-submitted in the request. ' + items: + $ref: '#/components/schemas/LocationOption' + description: Container for error list. + Errors: + required: + - Errors + - TransactionId + type: object + properties: + Errors: + type: array + description: Container for error list. + items: + $ref: '#/components/schemas/Error' + TransactionId: + type: string + description: A unique identifier for the transaction. + example: a9e371c4-89d9-4f9c-8df7-df105830e7fe + xml: + name: ErrorResponse + GeoLocation: + required: + - Latitude + - Longitude + type: object + properties: + Latitude: + type: string + description: Latitude of the location. + example: "38.184978" + Longitude: + type: string + description: Longitude of the location. + example: "85.7412" + Obfuscated: + type: boolean + description: Geographic information + Location: + type: object + properties: + Type: + type: string + description: The type of location code (MULTICITY | METROCODE). + example: MULTICITY + Id: + type: string + description: Expedia Region ID of the specified airport. + example: "6139103" + Name: + type: string + description: Location Name + example: Seattle-Tacoma International Airport + Code: + type: string + description: Location Code + example: SEA + LocationId: + type: string + description: Location id. + example: SEAT001 + Address: + $ref: '#/components/schemas/Address' + PointOfInterest: + type: string + GeoLocation: + $ref: '#/components/schemas/GeoLocation' + Neighborhood: + $ref: '#/components/schemas/Neighborhood' + RegionId: + type: integer + description: RegionId the location resides in. + format: int64 + example: 6200275 + Country: + $ref: '#/components/schemas/Country' + description: List of location(s) where the activity will happen. + LocationOption: + required: + - Locations + - RequestedLocation + type: object + properties: + RequestedLocation: + type: string + description: Location used in partner request. + example: Paris + Locations: + type: array + description: Container for list of possible locations that could be used to disambiguate the query. + items: + $ref: '#/components/schemas/Location' + Type: + type: string + description: Type of the location. + example: TRAINSTATION + RegionId: + type: string + description: RegionId the location resides in. + example: "6200275" + ShortName: + type: string + description: The name of the location which matches the location keyword. + example: Dublin Connolly Station + AirportCode: + type: string + description: Indicates the nearest major airport to the location. + example: DUB + Address: + type: string + description: The address of the location. + example: Dublin Connolly Station, Ireland + Country: + $ref: '#/components/schemas/Country' + GeoLocation: + $ref: '#/components/schemas/GeoLocation' + description: 'List for possible locations from which the customer must choose + the best one to be re-submitted in the request. ' + Neighborhood: + required: + - Id + - Name + type: object + properties: + Id: + type: string + description: Neighborhood id. + example: "6160232" + Name: + type: string + description: Neighborhood name. + example: Le Pharo + description: Geography entities which are typically contained within a city. This includes the categories neighborhood and point of interest. Low level regions are not a formally defined concept in the geography model. + Activity: + required: + - Categories + - Description + - Duration + - FreeCancellation + - Id + - Media + - Price + - Supplier + - Title + type: object + properties: + Id: + type: integer + description: The numerical identifier for this particular activity + format: int32 + example: 166597 + Title: + type: string + description: The display title for this activity. + example: 'Faster Than Skip-the-Line: Vatican, Sistine Chapel & St. Peter''s + Tour' + Description: + type: string + description: The description of the Activity. + example: Enjoy 5 of Seattle's most popular attractions with a multi-ticket booklet that’s valid for 9 consecutive days. This pass is perfect if you want to explore the city on your schedule, craft your own itinerary, and visit the city’s can’t-miss museums and most iconi... + Media: + type: array + description: List of activity Media. + items: + $ref: '#/components/schemas/Media' + Categories: + type: array + description: |- + A list of the Activity categories to which this particular activity belongs. + Possible values are: + Adventures + Air, Balloon & Helicopter Tours + Attractions + Cruises & Water Tours + Day Trips & Excursions + Food & Drink + Hop-on Hop-off + Multi-Day & Extended Tours + Nightlife + Private Tours + Private Transfers + Shared Transfers + Show & Sport Tickets + Sightseeing Passes + Theme Parks + Tours & Sightseeing + Walking & Bike Tours + Water Activities + Wedding Ceremonies + Winter Activities + example: + - Walking & Bike Tours + items: + type: string + description: A list of the Activity categories to which this particular activity belongs. + example: Walking & Bike Tours + xml: + name: Categories + Duration: + type: string + description: |- + The anticipated time duration for the activity. + Using java jdk Duration parsing. + example: PT1H0M + FreeCancellation: + type: boolean + description: A boolean value describing whether or not this activity reservation can be cancelled without incurring a penalty. + example: true + Price: + $ref: '#/components/schemas/Price' + Redemption: + $ref: '#/components/schemas/Redemption' + ActivityLocations: + type: array + description: Container of location information where activity happens. + items: + $ref: '#/components/schemas/Location' + Supplier: + $ref: '#/components/schemas/Supplier' + ReviewScore: + type: integer + description: The overall Expedia score for the activity. + format: int32 + example: 72 + ReviewCount: + type: integer + description: The number of Expedia reviews that went into the calculation of the ReviewScore. + format: int32 + example: 19 + Links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + description: HATEOAS links included in this response. + xml: + wrapped: true + CancellationPolicy: + $ref: '#/components/schemas/CancellationPolicy' + Highlights: + type: array + description: Web formatted statement of the Highlight(s) for the activity. + items: + type: string + description: Web formatted statement of the Highlight(s) for the activity. + xml: + name: Highlights + TermsAndConditions: + type: array + description: Terms and Conditions for the Activity. + items: + type: string + description: Terms and Conditions for the Activity. + xml: + name: TermsAndConditions + Inclusions: + type: array + description: Web formatted statement of what is included in the activity + items: + type: string + description: Web formatted statement of what is included in the activity + xml: + name: Inclusions + Exclusions: + type: array + description: Web formatted statement of what is NOT included in the activity + items: + type: string + description: Web formatted statement of what is NOT included in the activity + xml: + name: Exclusions + KnowBeforeYouBook: + type: array + description: Web formatted statement of things that a purchaser should be aware of BEFORE they book this activity. + items: + type: string + description: Web formatted statement of things that a purchaser should be aware of BEFORE they book this activity. + xml: + name: KnowBeforeYouBook + KnowBeforeYouGo: + type: array + description: Web formatted statement of things that a purchaser should be aware of BEFORE they go to this activity. + items: + type: string + description: Web formatted statement of things that a purchaser should be aware of BEFORE they go to this activity. + xml: + name: KnowBeforeYouGo + Offers: + type: array + description: Offers for the activity. + items: + $ref: '#/components/schemas/Offer' + description: Detailed information on the Activity. + AvailableTimeSlot: + required: + - AllDayActivity + - CancellationPolicy + - DateTime + - Tickets + type: object + properties: + DateTime: + type: string + description: The date and time when the activity happens. + format: date-time + AllDayActivity: + type: boolean + description: Indicates whether the activity is an all-day activity. + example: true + CancellationPolicy: + $ref: '#/components/schemas/CancellationPolicy' + Tickets: + type: array + description: Container for ticket information. + items: + $ref: '#/components/schemas/Ticket' + description: The list of available Time Slots for the activity. + CancellationPolicy: + required: + - FreeCancellation + type: object + properties: + FreeCancellation: + type: boolean + description: Indicates whether the activity can be canceled free of charge within the cancellation window or not. + example: true + CancelPolicyDescription: + type: string + description: The description of Cancellation Policy. + example: 72 hours + FreeCancellationMinHours: + type: integer + description: The minimum number of hours before activity when the activity can still be cancelled for free. + format: int32 + example: 72 + FreeCancellationEndDateTime: + type: string + description: The date and time after which the activity will not be able to be cancelled for free, stated in the local time to where the activity takes place. + format: date-time + description: Container for the Cancellation Policy information. + Link: + required: + - Href + type: object + properties: + Accept: + type: string + description: Accept header. + Method: + type: string + description: HTTP method to connect. + example: GET + Href: + type: string + description: HATEOAS URL to fetch details. + description: Container of HATEOAS URL's + Media: + required: + - Size + - Type + - Url + type: object + properties: + Type: + type: string + description: |- + type of the media. So far there is only one option: + 1: Image + example: "1" + Title: + type: string + description: Image title + example: Guestroom + Size: + type: string + description: |- + Image size + You can find a link to the complete list of Supported Images Sizes in the Related Links section at the bottom of the page. + example: t + Url: + type: string + description: Image URL + example: https://images.trvl-media.com/hotels/1000000/30000/20300/20230/20230_159_t.jpg + description: List of activity Media. + Offer: + required: + - AvailableTimeSlots + - Duration + - Id + - OfferPrice + - Title + type: object + properties: + Id: + type: integer + description: The numerical identifier for the offer. + format: int32 + example: 166597 + Title: + type: string + description: A descriptive title for this offer. + example: 8:30 AM, Tour in English + Description: + type: string + description: Description of this offer. + Duration: + type: string + description: The anticipated time duration for the activity, e xpressed using Java JDK duration format. + AvailableTimeSlots: + type: array + description: The list of available Time Slots for the activity. + items: + $ref: '#/components/schemas/AvailableTimeSlot' + OfferPrice: + $ref: '#/components/schemas/Price' + Links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + description: Container of HATEOAS URL's + xml: + wrapped: true + description: Offers for the activity. + Phone: + required: + - CountryCode + - Number + type: object + properties: + CountryCode: + type: string + description: Country code of traveler's phone number; only digits allowed. + example: "1" + AreaCode: + type: string + description: Area code of traveler's phone number; only digits allowed. + example: "614" + Number: + type: string + description: Traveler's phone number; only digits allowed. + example: "9288472" + ExtensionNumber: + type: string + description: The phone of the company providing the activity. + Redemption: + type: object + properties: + Type: + type: string + description: The type of redemption process associated to the activity. + example: Voucherless + RedemptionLocations: + type: array + description: List of redemption locations where the activity will take place, please refer to Location Section below. + items: + $ref: '#/components/schemas/Location' + description: Container of redemption information. + Supplier: + required: + - Name + type: object + properties: + Name: + type: string + description: The name of the company providing the activity. + example: City Wonders + Phone: + $ref: '#/components/schemas/Phone' + description: The details information of company providing the activity. + Warning: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Standardized warning code. + example: INVALID_CORPORATE_DISCOUNT_CODE + Description: + type: string + description: Standardized warning description message. + example: The Corporate DiscountCode '811490' is unavailable, but we found other rates for you. + OriginalPrice: + $ref: '#/components/schemas/Money' + NewPrice: + $ref: '#/components/schemas/Money' + ChangedAmount: + $ref: '#/components/schemas/Money' + ChangedPercentage: + type: string + description: |- + The changed percentage. + In the sample 2.97 means the changed percentage is 2.97%. + example: "2.97" + Links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + xml: + wrapped: true + description: Container for all warnings generated during the transaction. + ActivityListingsResponse: + required: + - Count + - Location + - TransactionId + type: object + properties: + Warnings: + type: array + description: Container for all warnings generated during the transaction. + items: + $ref: '#/components/schemas/Warning' + TransactionId: + type: string + description: A unique identifier for this transaction. + example: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + Count: + type: integer + description: The number of activities returned in the response. + format: int64 + example: 100 + Location: + type: string + description: The location that the user searched, expressed in the exact format that the inventory system uses to designate the location. + example: shenzhen, dg + StartDate: + type: string + description: The startDate of the returned group of activities in YYYY-MM-DD format. + format: date + example: 2021-08-01 + EndDate: + type: string + description: The endDate of returned group of activities in YYYY-MM-DD format. + format: date + example: 2021-08-10 + Activities: + type: array + description: List of activities matching the search criteria. + items: + $ref: '#/components/schemas/Activity' + Categories: + type: array + description: Container for a breakdown of how many of each type of Activity have been returned in the API response. + items: + $ref: '#/components/schemas/CategoryGroup' + CategoryGroup: + required: + - CategoryName + - Count + - GroupDisplayName + - GroupName + type: object + properties: + Count: + type: integer + description: The count of the number of categories the returned set of activities map to. + format: int32 + example: 10 + GroupName: + type: string + description: |- + The group which the category belongs + Possible value is: + Recommendations + Tours + Activities + Transportation + Promotions + Duration + example: Tours + GroupDisplayName: + type: string + description: The localized value for category name. + example: Wander- und Fahrradtouren + CategoryName: + type: string + description: The name of one of the categories. + example: Walking & Bike Tours + CategoryDisplayName: + type: string + description: Container for a breakdown of how many of each type of Activity have been returned in the API response. + ActivityDetailsResponse: + required: + - Location + - TransactionId + type: object + properties: + Warnings: + type: array + description: Container for all warnings generated during the transaction. + items: + $ref: '#/components/schemas/Warning' + TransactionId: + type: string + description: A unique identifier for this transaction. + example: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + Location: + type: string + description: The location user searched, translated into the full, unambiguous format. + example: shenzhen, dg + StartDate: + type: string + description: The startDate of activities in YYY-MM-DD format. + format: date + example: 2021-08-01 + EndDate: + type: string + description: The endDate of activities in YYY-MM-DD format. + format: date + example: 2021-08-01 + ActivityDetails: + $ref: '#/components/schemas/Activity' + APIMError: + title: APIMError + properties: + message: + type: string + securitySchemes: + basicSchema: + type: http + scheme: basic From 37bea813b535a60c4439cc945e5ccb52e1ca500c Mon Sep 17 00:00:00 2001 From: Nasser Anssari Date: Sun, 19 Jan 2025 15:50:37 +0300 Subject: [PATCH 02/16] chore: add PR check to verify examples and integration tests (#45) --- .../workflows/verify-examples-and-tests.yaml | 60 +++++++++++++++++++ README.md | 4 +- {integrations => tests/integration}/README.md | 2 +- {integrations => tests/integration}/pom.xml | 0 .../sdk/xap/integrations/common/Constant.java | 0 .../common/XapIntegrationTests.java | 2 +- ...AvailabilityCalendarsIntegrationTests.java | 2 +- .../lodging/ListingsIntegrationTests.java | 4 +- .../lodging/QuotesIntegrationTests.java | 2 +- .../lodging/VrboIntegrationTests.java | 4 +- 10 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/verify-examples-and-tests.yaml rename {integrations => tests/integration}/README.md (98%) rename {integrations => tests/integration}/pom.xml (100%) rename {integrations => tests/integration}/src/test/java/com/expediagroup/sdk/xap/integrations/common/Constant.java (100%) rename integrations/src/test/java/com/expediagroup/sdk/xap/integrations/common/XapIT.java => tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/XapIntegrationTests.java (97%) rename integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/AvailabilityCalendarsIT.java => tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/AvailabilityCalendarsIntegrationTests.java (98%) rename integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/ListingsIT.java => tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/ListingsIntegrationTests.java (99%) rename integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/QuotesIT.java => tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/QuotesIntegrationTests.java (99%) rename integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/VrboIT.java => tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/VrboIntegrationTests.java (84%) diff --git a/.github/workflows/verify-examples-and-tests.yaml b/.github/workflows/verify-examples-and-tests.yaml new file mode 100644 index 00000000..038117f3 --- /dev/null +++ b/.github/workflows/verify-examples-and-tests.yaml @@ -0,0 +1,60 @@ +name: Verify Examples and Integration Tests +on: + pull_request: + branches: + - 'main' +jobs: + detect-changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + outputs: + examples: ${{ steps.filter.outputs.examples }} + integration-tests: ${{ steps.filter.outputs.integration-tests }} + steps: + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + examples: + - 'examples/**' + integration-tests: + - 'tests/integration/**' + + verify-examples: + needs: detect-changes + if: ${{ needs.detect-changes.outputs.examples == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + - name: verify examples + working-directory: examples + run: | + mvn verify \ + -Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \ + -Dcom.expediagroup.xapjavasdk.apisecret="${{ secrets.API_SECRET }}" \ + -Dcom.expediagroup.xapjavasdk.vrbokey="${{ secrets.VRBO_KEY }}" \ + -Dcom.expediagroup.xapjavasdk.vrbosecret="${{ secrets.VRBO_SECRET }}" \ + + verify-integration-tests: + needs: detect-changes + if: ${{ needs.detect-changes.outputs.integration-tests == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + - name: verify integration tests + working-directory: tests/integration + run: | + mvn verify \ + -Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \ + -Dcom.expediagroup.xapjavasdk.apisecret="${{ secrets.API_SECRET }}" \ + -Dcom.expediagroup.xapjavasdk.vrbokey="${{ secrets.VRBO_KEY }}" \ + -Dcom.expediagroup.xapjavasdk.vrbosecret="${{ secrets.VRBO_SECRET }}" diff --git a/README.md b/README.md index 539b4d28..92f6ab3b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ and less on the technical details of the API. You can find code examples for multiple use cases in the [examples](examples) directory. ### Integration Tests -Integration tests are placed in the [integrations](integrations) directory. +Integration tests are placed in the [integrations](tests/integration) directory. --- @@ -27,4 +27,4 @@ If you have any questions or need help with XAP, please refer to the [XAP Support](https://developers.expediagroup.com/xap/support) page. If you experience any issues with the SDK, please raise an issue on the -[GitHub repository](https://github.com/ExpediaGroup/xap-java-sdk/issues). \ No newline at end of file +[GitHub repository](https://github.com/ExpediaGroup/xap-java-sdk/issues). diff --git a/integrations/README.md b/tests/integration/README.md similarity index 98% rename from integrations/README.md rename to tests/integration/README.md index 0d9f73c7..87117d93 100644 --- a/integrations/README.md +++ b/tests/integration/README.md @@ -84,4 +84,4 @@ account manager. ## License -This project is licensed under the Apache License v2.0 - see the [LICENSE](../LICENSE) for details. \ No newline at end of file +This project is licensed under the Apache License v2.0 - see the [LICENSE](../../LICENSE) for details. diff --git a/integrations/pom.xml b/tests/integration/pom.xml similarity index 100% rename from integrations/pom.xml rename to tests/integration/pom.xml diff --git a/integrations/src/test/java/com/expediagroup/sdk/xap/integrations/common/Constant.java b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/Constant.java similarity index 100% rename from integrations/src/test/java/com/expediagroup/sdk/xap/integrations/common/Constant.java rename to tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/Constant.java diff --git a/integrations/src/test/java/com/expediagroup/sdk/xap/integrations/common/XapIT.java b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/XapIntegrationTests.java similarity index 97% rename from integrations/src/test/java/com/expediagroup/sdk/xap/integrations/common/XapIT.java rename to tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/XapIntegrationTests.java index 8d5b10c8..6b8288cb 100644 --- a/integrations/src/test/java/com/expediagroup/sdk/xap/integrations/common/XapIT.java +++ b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/XapIntegrationTests.java @@ -15,7 +15,7 @@ * Extension for setting up the required components for testing. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -public abstract class XapIT { +public abstract class XapIntegrationTests { protected static XapClient xapClient; protected static XapClient mockClient; diff --git a/integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/AvailabilityCalendarsIT.java b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/AvailabilityCalendarsIntegrationTests.java similarity index 98% rename from integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/AvailabilityCalendarsIT.java rename to tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/AvailabilityCalendarsIntegrationTests.java index 6809772b..d6f77328 100644 --- a/integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/AvailabilityCalendarsIT.java +++ b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/AvailabilityCalendarsIntegrationTests.java @@ -28,7 +28,7 @@ /** * This class is used to test the integration of the Lodging Availability Calendars API. */ -public class AvailabilityCalendarsIT extends VrboIT { +public class AvailabilityCalendarsIntegrationTests extends VrboIntegrationTests { @Test public void testRequest() { diff --git a/integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/ListingsIT.java b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/ListingsIntegrationTests.java similarity index 99% rename from integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/ListingsIT.java rename to tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/ListingsIntegrationTests.java index 94b8e823..7b61b733 100644 --- a/integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/ListingsIT.java +++ b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/ListingsIntegrationTests.java @@ -6,7 +6,7 @@ import com.expediagroup.sdk.core.model.Response; import com.expediagroup.sdk.xap.integrations.common.Constant; -import com.expediagroup.sdk.xap.integrations.common.XapIT; +import com.expediagroup.sdk.xap.integrations.common.XapIntegrationTests; import com.expediagroup.sdk.xap.models.AgeClassRestriction; import com.expediagroup.sdk.xap.models.BedType; import com.expediagroup.sdk.xap.models.CancellationPolicy; @@ -62,7 +62,7 @@ /** * This class is used to test the integration of the Lodging Listings API. */ -public class ListingsIT extends XapIT { +public class ListingsIntegrationTests extends XapIntegrationTests { @Test public void testRequest() { diff --git a/integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/QuotesIT.java b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/QuotesIntegrationTests.java similarity index 99% rename from integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/QuotesIT.java rename to tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/QuotesIntegrationTests.java index 9177d94a..8ba71318 100644 --- a/integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/QuotesIT.java +++ b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/QuotesIntegrationTests.java @@ -35,7 +35,7 @@ /** * This class is used to test the integration of the Lodging Quotes API. */ -public class QuotesIT extends VrboIT { +public class QuotesIntegrationTests extends VrboIntegrationTests { @Test public void testRequest() { diff --git a/integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/VrboIT.java b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/VrboIntegrationTests.java similarity index 84% rename from integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/VrboIT.java rename to tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/VrboIntegrationTests.java index be4dd7ab..fb76f6fa 100644 --- a/integrations/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/VrboIT.java +++ b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/VrboIntegrationTests.java @@ -1,14 +1,14 @@ package com.expediagroup.sdk.xap.integrations.lodging; import com.expediagroup.sdk.xap.client.XapClient; -import com.expediagroup.sdk.xap.integrations.common.XapIT; +import com.expediagroup.sdk.xap.integrations.common.XapIntegrationTests; import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.BeforeAll; /** * Extension for setting up the required components for testing, specifically for Vrbo. */ -public abstract class VrboIT extends XapIT { +public abstract class VrboIntegrationTests extends XapIntegrationTests { @BeforeAll static void vrboSetup() { From 59a2f6bb7f629d09219e859233492184e4bf9b4a Mon Sep 17 00:00:00 2001 From: Nasser Anssari Date: Sun, 19 Jan 2025 16:09:45 +0300 Subject: [PATCH 03/16] chore: update generate SDK action version (#49) --- .../generate-and-publish-sdk-sources.yaml | 9 +++++---- ...ration-test.yaml => integration-tests.yaml} | 2 +- .github/workflows/release-sdk.yaml | 18 ++++-------------- 3 files changed, 10 insertions(+), 19 deletions(-) rename .github/workflows/{integration-test.yaml => integration-tests.yaml} (97%) diff --git a/.github/workflows/generate-and-publish-sdk-sources.yaml b/.github/workflows/generate-and-publish-sdk-sources.yaml index c1131738..2b6907ff 100644 --- a/.github/workflows/generate-and-publish-sdk-sources.yaml +++ b/.github/workflows/generate-and-publish-sdk-sources.yaml @@ -12,11 +12,12 @@ on: jobs: generate-and-publish-sources: - uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-full-workflow.yaml@v20241126 + uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-full-workflow.yaml@v20241217 secrets: inherit with: name: xap - version: ${{ inputs.version }} - transformations: "--headers key --operationIdsToTags" - repository: 'ExpediaGroup/xap-java-sdk' ref: ${{ github.head_ref || github.ref_name }} + repository: 'ExpediaGroup/xap-java-sdk' + sdk_repo_ref: 'v20241217' + transformations: '--headers key --operationIdsToTags' + version: ${{ inputs.version }} diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-tests.yaml similarity index 97% rename from .github/workflows/integration-test.yaml rename to .github/workflows/integration-tests.yaml index 3887c821..f75a1cda 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-tests.yaml @@ -55,7 +55,7 @@ jobs: mvn clean install - name: Run Integration Tests - working-directory: sdk-repo/integrations + working-directory: sdk-repo/tests/integration run: | mvn verify \ -Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \ diff --git a/.github/workflows/release-sdk.yaml b/.github/workflows/release-sdk.yaml index 052f45c2..a8312a92 100644 --- a/.github/workflows/release-sdk.yaml +++ b/.github/workflows/release-sdk.yaml @@ -11,29 +11,19 @@ on: default: '' jobs: - run-examples: + integration-tests: strategy: matrix: jdk: [ 8, 11, 17, 21 ] - uses: ./.github/workflows/run-examples.yaml - secrets: inherit - with: - branch: ${{ inputs.branch }} - jdk: ${{ matrix.jdk }} - - integration-test: - strategy: - matrix: - jdk: [ 8, 11, 17, 21 ] - uses: ./.github/workflows/integration-test.yaml + uses: ./.github/workflows/integration-tests.yaml secrets: inherit with: branch: ${{ inputs.branch }} jdk: ${{ matrix.jdk }} release-sdk: - uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-release-sdk.yaml@v20241126 - needs: [ run-examples ] + uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-release-sdk.yaml@v20241217 + needs: [ integration-tests ] secrets: inherit with: branch: ${{ inputs.branch }} From e6a736f021a7317c4a44fb49b4cd59499ea279e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 19 Jan 2025 16:38:09 +0300 Subject: [PATCH 04/16] chore: Publish v1.1.0 (#51) --- code/README.md | 2 +- code/pom.xml | 14 +- .../sdk/core/client/BaseRapidClient.kt | 5 +- .../sdk/core/client/BaseXapClient.kt | 5 +- .../expediagroup/sdk/xap/client/XapClient.kt | 47 + .../sdk/xap/models/ActivitiesAddress.kt | 153 ++ .../models/ActivitiesCancellationPolicy.kt | 123 ++ .../sdk/xap/models/ActivitiesCountry.kt | 127 ++ .../sdk/xap/models/ActivitiesError.kt | 137 ++ .../sdk/xap/models/ActivitiesErrors.kt | 110 ++ .../sdk/xap/models/ActivitiesGeoLocation.kt | 115 ++ .../sdk/xap/models/ActivitiesLink.kt | 115 ++ .../sdk/xap/models/ActivitiesLocation.kt | 191 +++ .../xap/models/ActivitiesLocationOption.kt | 180 +++ .../sdk/xap/models/ActivitiesMedia.kt | 127 ++ .../sdk/xap/models/ActivitiesMoney.kt | 115 ++ .../sdk/xap/models/ActivitiesNeighborhood.kt | 106 ++ .../sdk/xap/models/ActivitiesPhone.kt | 125 ++ .../sdk/xap/models/ActivitiesPrice.kt | 143 ++ .../sdk/xap/models/ActivitiesSupplier.kt | 105 ++ .../sdk/xap/models/ActivitiesWarning.kt | 154 ++ .../expediagroup/sdk/xap/models/Activity.kt | 319 ++++ .../sdk/xap/models/ActivityDetailsResponse.kt | 145 ++ .../xap/models/ActivityListingsResponse.kt | 166 ++ .../sdk/xap/models/AvailableTimeSlot.kt | 130 ++ .../sdk/xap/models/CategoryGroup.kt | 135 ++ .../com/expediagroup/sdk/xap/models/Offer.kt | 162 ++ .../expediagroup/sdk/xap/models/Redemption.kt | 104 ++ .../sdk/xap/models/ReferencePrice.kt | 113 ++ .../sdk/xap/models/Restrictions.kt | 127 ++ .../expediagroup/sdk/xap/models/Savings.kt | 104 ++ .../com/expediagroup/sdk/xap/models/Ticket.kt | 134 ++ .../sdk/xap/models/exception/ApiException.kt | 38 +- .../operations/GetActivityDetailsOperation.kt | 44 + .../GetActivityDetailsOperationParams.kt | 132 ++ .../GetActivityListingsOperation.kt | 35 + .../GetActivityListingsOperationParams.kt | 206 +++ code/transformedSpecs.yaml | 1368 +++++++++++++++++ 38 files changed, 5650 insertions(+), 11 deletions(-) create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt diff --git a/code/README.md b/code/README.md index 779b9c31..8666c82f 100644 --- a/code/README.md +++ b/code/README.md @@ -5,7 +5,7 @@ com.expediagroup xap-sdk - 1.0.0 + 1.1.0 ``` diff --git a/code/pom.xml b/code/pom.xml index da297311..208d3d4c 100644 --- a/code/pom.xml +++ b/code/pom.xml @@ -4,9 +4,9 @@ 4.0.0 com.expediagroup xap-sdk - 1.0.0 + 1.1.0 EG xap-sdk for Java - EG xap-sdk v1.0.0 + EG xap-sdk v1.1.0 https://github.com/ExpediaGroup/test-sdk 2022 jar @@ -82,7 +82,7 @@ 2.0.21 1.9.0 2.3.13 - 0.26.0 + 0.26.1 2.0.16 1.7.0 3.2.7 @@ -131,7 +131,7 @@ com.fasterxml.jackson jackson-bom - 2.18.1 + 2.18.2 pom import @@ -153,7 +153,7 @@ com.fasterxml.jackson.core jackson-annotations - 2.18.1 + 2.18.2 @@ -744,13 +744,13 @@ com.ebay.ejmask ejmask-api - 1.0.3 + 1.3.0 com.ebay.ejmask ejmask-extensions - 1.0.3 + 1.3.0 diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt index 464730e1..d11f25e9 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt +++ b/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt @@ -44,7 +44,10 @@ abstract class BaseRapidClient( private val engine: HttpClientEngine = _configurationProvider.okHttpClient?.let { OkHttp.create { - preconfigured = it + config { + preconfigured = it + dispatcher(it.dispatcher) + } } } ?: httpClientEngine diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt index 20dee681..2f440dc3 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt +++ b/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt @@ -44,7 +44,10 @@ abstract class BaseXapClient( private val engine: HttpClientEngine = _configurationProvider.okHttpClient?.let { OkHttp.create { - preconfigured = it + config { + preconfigured = it + dispatcher(it.dispatcher) + } } } ?: httpClientEngine diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt index d29a4141..0be57e54 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt @@ -29,11 +29,14 @@ import com.expediagroup.sdk.xap.models.* import com.expediagroup.sdk.xap.models.exception.ErrorObjectMapper import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiAPIGatewayErrorException import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiAPIMErrorException +import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiActivitiesErrorsException import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiCarsErrorsException import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiErrorsException import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiLodgingErrorsException import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiPresignedUrlResponseException import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiSdpAPIMErrorException +import com.expediagroup.sdk.xap.operations.GetActivityDetailsOperation +import com.expediagroup.sdk.xap.operations.GetActivityListingsOperation import com.expediagroup.sdk.xap.operations.GetCarDetailsOperation import com.expediagroup.sdk.xap.operations.GetCarsListingsOperation import com.expediagroup.sdk.xap.operations.GetFeedDownloadUrlOperation @@ -154,6 +157,50 @@ class XapClient private constructor(clientConfiguration: XapClientConfiguration) } } + /** + * + * The Activity Details API provides detailed information about one selected activity. + * @param operation [GetActivityDetailsOperation] + * @throws ExpediaGroupApiActivitiesErrorsException + * @throws ExpediaGroupApiAPIMErrorException + * @throws ExpediaGroupApiException + * @return a [Response] object with a body of type ActivityDetailsResponse + */ + fun execute(operation: GetActivityDetailsOperation): Response = execute(operation) + + /** + * + * The Activity Details API provides detailed information about one selected activity. + * @param operation [GetActivityDetailsOperation] + * @throws ExpediaGroupApiActivitiesErrorsException + * @throws ExpediaGroupApiAPIMErrorException + * @throws ExpediaGroupApiException + * @return a [CompletableFuture] object with a body of type ActivityDetailsResponse + */ + fun executeAsync(operation: GetActivityDetailsOperation): CompletableFuture> = executeAsync(operation) + + /** + * + * The Activities Search API allows partners to search for Expedia Activity inventory. + * @param operation [GetActivityListingsOperation] + * @throws ExpediaGroupApiActivitiesErrorsException + * @throws ExpediaGroupApiAPIMErrorException + * @throws ExpediaGroupApiException + * @return a [Response] object with a body of type ActivityListingsResponse + */ + fun execute(operation: GetActivityListingsOperation): Response = execute(operation) + + /** + * + * The Activities Search API allows partners to search for Expedia Activity inventory. + * @param operation [GetActivityListingsOperation] + * @throws ExpediaGroupApiActivitiesErrorsException + * @throws ExpediaGroupApiAPIMErrorException + * @throws ExpediaGroupApiException + * @return a [CompletableFuture] object with a body of type ActivityListingsResponse + */ + fun executeAsync(operation: GetActivityListingsOperation): CompletableFuture> = executeAsync(operation) + /** * Get Extended information with a single car offer * Extended information about the rates, charges, fees, and other terms associated with a single car offer. diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt new file mode 100644 index 00000000..f159e2b5 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt @@ -0,0 +1,153 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation + +/** + * Address information + * @param address1 Street Number, Street Name, or PO Box. + * @param address2 Apartment, Floor, Suite, Bldg + * @param suite Suite/apartment number + * @param city The city + * @param province The state or province. + * @param country 3-letter code for the country. + * @param postalCode Zip/postal code. + */ +data class ActivitiesAddress( + // Street Number, Street Name, or PO Box. + @JsonProperty("Address1") + @field:Valid + val address1: kotlin.String? = null, + // Apartment, Floor, Suite, Bldg + @JsonProperty("Address2") + @field:Valid + val address2: kotlin.String? = null, + // Suite/apartment number + @JsonProperty("Suite") + @field:Valid + val suite: kotlin.String? = null, + // The city + @JsonProperty("City") + @field:Valid + val city: kotlin.String? = null, + // The state or province. + @JsonProperty("Province") + @field:Valid + val province: kotlin.String? = null, + // 3-letter code for the country. + @JsonProperty("Country") + @field:Valid + val country: kotlin.String? = null, + // Zip/postal code. + @JsonProperty("PostalCode") + @field:Valid + val postalCode: kotlin.String? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var address1: kotlin.String? = null, + private var address2: kotlin.String? = null, + private var suite: kotlin.String? = null, + private var city: kotlin.String? = null, + private var province: kotlin.String? = null, + private var country: kotlin.String? = null, + private var postalCode: kotlin.String? = null + ) { + fun address1(address1: kotlin.String?) = apply { this.address1 = address1 } + + fun address2(address2: kotlin.String?) = apply { this.address2 = address2 } + + fun suite(suite: kotlin.String?) = apply { this.suite = suite } + + fun city(city: kotlin.String?) = apply { this.city = city } + + fun province(province: kotlin.String?) = apply { this.province = province } + + fun country(country: kotlin.String?) = apply { this.country = country } + + fun postalCode(postalCode: kotlin.String?) = apply { this.postalCode = postalCode } + + fun build(): ActivitiesAddress { + val instance = + ActivitiesAddress( + address1 = address1, + address2 = address2, + suite = suite, + city = city, + province = province, + country = country, + postalCode = postalCode + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesAddress) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + address1 = address1, + address2 = address2, + suite = suite, + city = city, + province = province, + country = country, + postalCode = postalCode + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt new file mode 100644 index 00000000..79657c6a --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Container for the Cancellation Policy information. + * @param freeCancellation Indicates whether the activity can be canceled free of charge within the cancellation window or not. + * @param cancelPolicyDescription The description of Cancellation Policy. + * @param freeCancellationMinHours The minimum number of hours before activity when the activity can still be cancelled for free. + * @param freeCancellationEndDateTime The date and time after which the activity will not be able to be cancelled for free, stated in the local time to where the activity takes place. + */ +data class ActivitiesCancellationPolicy( + // Indicates whether the activity can be canceled free of charge within the cancellation window or not. + @JsonProperty("FreeCancellation") + @field:NotNull + @field:Valid + val freeCancellation: kotlin.Boolean, + // The description of Cancellation Policy. + @JsonProperty("CancelPolicyDescription") + @field:Valid + val cancelPolicyDescription: kotlin.String? = null, + // The minimum number of hours before activity when the activity can still be cancelled for free. + @JsonProperty("FreeCancellationMinHours") + val freeCancellationMinHours: kotlin.Int? = null, + // The date and time after which the activity will not be able to be cancelled for free, stated in the local time to where the activity takes place. + @JsonProperty("FreeCancellationEndDateTime") + val freeCancellationEndDateTime: java.time.LocalDateTime? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var freeCancellation: kotlin.Boolean? = null, + private var cancelPolicyDescription: kotlin.String? = null, + private var freeCancellationMinHours: kotlin.Int? = null, + private var freeCancellationEndDateTime: java.time.LocalDateTime? = null + ) { + fun freeCancellation(freeCancellation: kotlin.Boolean) = apply { this.freeCancellation = freeCancellation } + + fun cancelPolicyDescription(cancelPolicyDescription: kotlin.String?) = apply { this.cancelPolicyDescription = cancelPolicyDescription } + + fun freeCancellationMinHours(freeCancellationMinHours: kotlin.Int?) = apply { this.freeCancellationMinHours = freeCancellationMinHours } + + fun freeCancellationEndDateTime(freeCancellationEndDateTime: java.time.LocalDateTime?) = apply { this.freeCancellationEndDateTime = freeCancellationEndDateTime } + + fun build(): ActivitiesCancellationPolicy { + val instance = + ActivitiesCancellationPolicy( + freeCancellation = freeCancellation!!, + cancelPolicyDescription = cancelPolicyDescription, + freeCancellationMinHours = freeCancellationMinHours, + freeCancellationEndDateTime = freeCancellationEndDateTime + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesCancellationPolicy) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + freeCancellation = freeCancellation!!, + cancelPolicyDescription = cancelPolicyDescription, + freeCancellationMinHours = freeCancellationMinHours, + freeCancellationEndDateTime = freeCancellationEndDateTime + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt new file mode 100644 index 00000000..c8b05c7f --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Container for disambiguation country information + * @param name country name + * @param isoCode2 2-letter code for the country + * @param isoCode3 3-letter code for the country + * @param code 3-letter code for the country + */ +data class ActivitiesCountry( + // country name + @JsonProperty("Name") + @field:NotNull + @field:Valid + val name: kotlin.String, + // 2-letter code for the country + @JsonProperty("IsoCode2") + @field:NotNull + @field:Valid + val isoCode2: kotlin.String, + // 3-letter code for the country + @JsonProperty("IsoCode3") + @field:NotNull + @field:Valid + val isoCode3: kotlin.String, + // 3-letter code for the country + @JsonProperty("Code") + @field:Valid + val code: kotlin.String? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var name: kotlin.String? = null, + private var isoCode2: kotlin.String? = null, + private var isoCode3: kotlin.String? = null, + private var code: kotlin.String? = null + ) { + fun name(name: kotlin.String) = apply { this.name = name } + + fun isoCode2(isoCode2: kotlin.String) = apply { this.isoCode2 = isoCode2 } + + fun isoCode3(isoCode3: kotlin.String) = apply { this.isoCode3 = isoCode3 } + + fun code(code: kotlin.String?) = apply { this.code = code } + + fun build(): ActivitiesCountry { + val instance = + ActivitiesCountry( + name = name!!, + isoCode2 = isoCode2!!, + isoCode3 = isoCode3!!, + code = code + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesCountry) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + name = name!!, + isoCode2 = isoCode2!!, + isoCode3 = isoCode3!!, + code = code + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt new file mode 100644 index 00000000..af040135 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesLocationOption +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Container for error list. + * @param code Error code describing the issue + * @param description A simple description of what the error is. + * @param detailCode Detailed error code describing the issue. + * @param locationKeyword The requested location that caused the error. + * @param locationOptions List for possible locations from which the customer must choose the best one to be re-submitted in the request. + */ +data class ActivitiesError( + // Error code describing the issue + @JsonProperty("Code") + @field:NotNull + @field:Valid + val code: kotlin.String, + // A simple description of what the error is. + @JsonProperty("Description") + @field:NotNull + @field:Valid + val description: kotlin.String, + // Detailed error code describing the issue. + @JsonProperty("DetailCode") + @field:Valid + val detailCode: kotlin.String? = null, + // The requested location that caused the error. + @JsonProperty("LocationKeyword") + @field:Valid + val locationKeyword: kotlin.String? = null, + // List for possible locations from which the customer must choose the best one to be re-submitted in the request. + @JsonProperty("LocationOptions") + @field:Valid + val locationOptions: kotlin.collections.List? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var code: kotlin.String? = null, + private var description: kotlin.String? = null, + private var detailCode: kotlin.String? = null, + private var locationKeyword: kotlin.String? = null, + private var locationOptions: kotlin.collections.List? = null + ) { + fun code(code: kotlin.String) = apply { this.code = code } + + fun description(description: kotlin.String) = apply { this.description = description } + + fun detailCode(detailCode: kotlin.String?) = apply { this.detailCode = detailCode } + + fun locationKeyword(locationKeyword: kotlin.String?) = apply { this.locationKeyword = locationKeyword } + + fun locationOptions(locationOptions: kotlin.collections.List?) = apply { this.locationOptions = locationOptions } + + fun build(): ActivitiesError { + val instance = + ActivitiesError( + code = code!!, + description = description!!, + detailCode = detailCode, + locationKeyword = locationKeyword, + locationOptions = locationOptions + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesError) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + code = code!!, + description = description!!, + detailCode = detailCode, + locationKeyword = locationKeyword, + locationOptions = locationOptions + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt new file mode 100644 index 00000000..1295fed1 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesError +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * + * @param errors Container for error list. + * @param transactionId A unique identifier for the transaction. + */ +data class ActivitiesErrors( + // Container for error list. + @JsonProperty("Errors") + @field:NotNull + @field:Valid + val errors: kotlin.collections + .List< + ActivitiesError + >, + // A unique identifier for the transaction. + @JsonProperty("TransactionId") + @field:NotNull + @field:Valid + val transactionId: kotlin.String +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var errors: kotlin.collections.List? = null, + private var transactionId: kotlin.String? = null + ) { + fun errors(errors: kotlin.collections.List) = apply { this.errors = errors } + + fun transactionId(transactionId: kotlin.String) = apply { this.transactionId = transactionId } + + fun build(): ActivitiesErrors { + val instance = + ActivitiesErrors( + errors = errors!!, + transactionId = transactionId!! + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesErrors) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + errors = errors!!, + transactionId = transactionId!! + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt new file mode 100644 index 00000000..e14ba368 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Geographic information + * @param latitude Latitude of the location. + * @param longitude Longitude of the location. + * @param obfuscated + */ +data class ActivitiesGeoLocation( + // Latitude of the location. + @JsonProperty("Latitude") + @field:NotNull + @field:Valid + val latitude: kotlin.String, + // Longitude of the location. + @JsonProperty("Longitude") + @field:NotNull + @field:Valid + val longitude: kotlin.String, + @JsonProperty("Obfuscated") + @field:Valid + val obfuscated: kotlin.Boolean? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var latitude: kotlin.String? = null, + private var longitude: kotlin.String? = null, + private var obfuscated: kotlin.Boolean? = null + ) { + fun latitude(latitude: kotlin.String) = apply { this.latitude = latitude } + + fun longitude(longitude: kotlin.String) = apply { this.longitude = longitude } + + fun obfuscated(obfuscated: kotlin.Boolean?) = apply { this.obfuscated = obfuscated } + + fun build(): ActivitiesGeoLocation { + val instance = + ActivitiesGeoLocation( + latitude = latitude!!, + longitude = longitude!!, + obfuscated = obfuscated + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesGeoLocation) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + latitude = latitude!!, + longitude = longitude!!, + obfuscated = obfuscated + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt new file mode 100644 index 00000000..f34efbe3 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Container of HATEOAS URL's + * @param href HATEOAS URL to fetch details. + * @param accept Accept header. + * @param method HTTP method to connect. + */ +data class ActivitiesLink( + // HATEOAS URL to fetch details. + @JsonProperty("Href") + @field:NotNull + @field:Valid + val href: kotlin.String, + // Accept header. + @JsonProperty("Accept") + @field:Valid + val accept: kotlin.String? = null, + // HTTP method to connect. + @JsonProperty("Method") + @field:Valid + val method: kotlin.String? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var href: kotlin.String? = null, + private var accept: kotlin.String? = null, + private var method: kotlin.String? = null + ) { + fun href(href: kotlin.String) = apply { this.href = href } + + fun accept(accept: kotlin.String?) = apply { this.accept = accept } + + fun method(method: kotlin.String?) = apply { this.method = method } + + fun build(): ActivitiesLink { + val instance = + ActivitiesLink( + href = href!!, + accept = accept, + method = method + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesLink) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + href = href!!, + accept = accept, + method = method + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt new file mode 100644 index 00000000..3c3cb2fe --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesAddress +import com.expediagroup.sdk.xap.models.ActivitiesCountry +import com.expediagroup.sdk.xap.models.ActivitiesGeoLocation +import com.expediagroup.sdk.xap.models.ActivitiesNeighborhood +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation + +/** + * List of location(s) where the activity will happen. + * @param type The type of location code (MULTICITY | METROCODE). + * @param id Expedia Region ID of the specified airport. + * @param name Location Name + * @param code Location Code + * @param locationId Location id. + * @param address + * @param pointOfInterest + * @param geoLocation + * @param neighborhood + * @param regionId RegionId the location resides in. + * @param country + */ +data class ActivitiesLocation( + // The type of location code (MULTICITY | METROCODE). + @JsonProperty("Type") + @field:Valid + val type: kotlin.String? = null, + // Expedia Region ID of the specified airport. + @JsonProperty("Id") + @field:Valid + val id: kotlin.String? = null, + // Location Name + @JsonProperty("Name") + @field:Valid + val name: kotlin.String? = null, + // Location Code + @JsonProperty("Code") + @field:Valid + val code: kotlin.String? = null, + // Location id. + @JsonProperty("LocationId") + @field:Valid + val locationId: kotlin.String? = null, + @JsonProperty("Address") + @field:Valid + val address: ActivitiesAddress? = null, + @JsonProperty("PointOfInterest") + @field:Valid + val pointOfInterest: kotlin.String? = null, + @JsonProperty("GeoLocation") + @field:Valid + val geoLocation: ActivitiesGeoLocation? = null, + @JsonProperty("Neighborhood") + @field:Valid + val neighborhood: ActivitiesNeighborhood? = null, + // RegionId the location resides in. + @JsonProperty("RegionId") + val regionId: kotlin.Long? = null, + @JsonProperty("Country") + @field:Valid + val country: ActivitiesCountry? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var type: kotlin.String? = null, + private var id: kotlin.String? = null, + private var name: kotlin.String? = null, + private var code: kotlin.String? = null, + private var locationId: kotlin.String? = null, + private var address: ActivitiesAddress? = null, + private var pointOfInterest: kotlin.String? = null, + private var geoLocation: ActivitiesGeoLocation? = null, + private var neighborhood: ActivitiesNeighborhood? = null, + private var regionId: kotlin.Long? = null, + private var country: ActivitiesCountry? = null + ) { + fun type(type: kotlin.String?) = apply { this.type = type } + + fun id(id: kotlin.String?) = apply { this.id = id } + + fun name(name: kotlin.String?) = apply { this.name = name } + + fun code(code: kotlin.String?) = apply { this.code = code } + + fun locationId(locationId: kotlin.String?) = apply { this.locationId = locationId } + + fun address(address: ActivitiesAddress?) = apply { this.address = address } + + fun pointOfInterest(pointOfInterest: kotlin.String?) = apply { this.pointOfInterest = pointOfInterest } + + fun geoLocation(geoLocation: ActivitiesGeoLocation?) = apply { this.geoLocation = geoLocation } + + fun neighborhood(neighborhood: ActivitiesNeighborhood?) = apply { this.neighborhood = neighborhood } + + fun regionId(regionId: kotlin.Long?) = apply { this.regionId = regionId } + + fun country(country: ActivitiesCountry?) = apply { this.country = country } + + fun build(): ActivitiesLocation { + val instance = + ActivitiesLocation( + type = type, + id = id, + name = name, + code = code, + locationId = locationId, + address = address, + pointOfInterest = pointOfInterest, + geoLocation = geoLocation, + neighborhood = neighborhood, + regionId = regionId, + country = country + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesLocation) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + type = type, + id = id, + name = name, + code = code, + locationId = locationId, + address = address, + pointOfInterest = pointOfInterest, + geoLocation = geoLocation, + neighborhood = neighborhood, + regionId = regionId, + country = country + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt new file mode 100644 index 00000000..88e54b69 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesCountry +import com.expediagroup.sdk.xap.models.ActivitiesGeoLocation +import com.expediagroup.sdk.xap.models.ActivitiesLocation +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * List for possible locations from which the customer must choose the best one to be re-submitted in the request. + * @param requestedLocation Location used in partner request. + * @param locations Container for list of possible locations that could be used to disambiguate the query. + * @param type Type of the location. + * @param regionId RegionId the location resides in. + * @param shortName The name of the location which matches the location keyword. + * @param airportCode Indicates the nearest major airport to the location. + * @param address The address of the location. + * @param country + * @param geoLocation + */ +data class ActivitiesLocationOption( + // Location used in partner request. + @JsonProperty("RequestedLocation") + @field:NotNull + @field:Valid + val requestedLocation: kotlin.String, + // Container for list of possible locations that could be used to disambiguate the query. + @JsonProperty("Locations") + @field:NotNull + @field:Valid + val locations: kotlin.collections + .List< + ActivitiesLocation + >, + // Type of the location. + @JsonProperty("Type") + @field:Valid + val type: kotlin.String? = null, + // RegionId the location resides in. + @JsonProperty("RegionId") + @field:Valid + val regionId: kotlin.String? = null, + // The name of the location which matches the location keyword. + @JsonProperty("ShortName") + @field:Valid + val shortName: kotlin.String? = null, + // Indicates the nearest major airport to the location. + @JsonProperty("AirportCode") + @field:Valid + val airportCode: kotlin.String? = null, + // The address of the location. + @JsonProperty("Address") + @field:Valid + val address: kotlin.String? = null, + @JsonProperty("Country") + @field:Valid + val country: ActivitiesCountry? = null, + @JsonProperty("GeoLocation") + @field:Valid + val geoLocation: ActivitiesGeoLocation? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var requestedLocation: kotlin.String? = null, + private var locations: kotlin.collections.List? = null, + private var type: kotlin.String? = null, + private var regionId: kotlin.String? = null, + private var shortName: kotlin.String? = null, + private var airportCode: kotlin.String? = null, + private var address: kotlin.String? = null, + private var country: ActivitiesCountry? = null, + private var geoLocation: ActivitiesGeoLocation? = null + ) { + fun requestedLocation(requestedLocation: kotlin.String) = apply { this.requestedLocation = requestedLocation } + + fun locations(locations: kotlin.collections.List) = apply { this.locations = locations } + + fun type(type: kotlin.String?) = apply { this.type = type } + + fun regionId(regionId: kotlin.String?) = apply { this.regionId = regionId } + + fun shortName(shortName: kotlin.String?) = apply { this.shortName = shortName } + + fun airportCode(airportCode: kotlin.String?) = apply { this.airportCode = airportCode } + + fun address(address: kotlin.String?) = apply { this.address = address } + + fun country(country: ActivitiesCountry?) = apply { this.country = country } + + fun geoLocation(geoLocation: ActivitiesGeoLocation?) = apply { this.geoLocation = geoLocation } + + fun build(): ActivitiesLocationOption { + val instance = + ActivitiesLocationOption( + requestedLocation = requestedLocation!!, + locations = locations!!, + type = type, + regionId = regionId, + shortName = shortName, + airportCode = airportCode, + address = address, + country = country, + geoLocation = geoLocation + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesLocationOption) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + requestedLocation = requestedLocation!!, + locations = locations!!, + type = type, + regionId = regionId, + shortName = shortName, + airportCode = airportCode, + address = address, + country = country, + geoLocation = geoLocation + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt new file mode 100644 index 00000000..b8ffe6ae --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * List of activity Media. + * @param type type of the media. So far there is only one option: 1: Image + * @param propertySize Image size You can find a link to the complete list of Supported Images Sizes in the Related Links section at the bottom of the page. + * @param url Image URL + * @param title Image title + */ +data class ActivitiesMedia( + // type of the media. So far there is only one option: 1: Image + @JsonProperty("Type") + @field:NotNull + @field:Valid + val type: kotlin.String, + // Image size You can find a link to the complete list of Supported Images Sizes in the Related Links section at the bottom of the page. + @JsonProperty("Size") + @field:NotNull + @field:Valid + val propertySize: kotlin.String, + // Image URL + @JsonProperty("Url") + @field:NotNull + @field:Valid + val url: kotlin.String, + // Image title + @JsonProperty("Title") + @field:Valid + val title: kotlin.String? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var type: kotlin.String? = null, + private var propertySize: kotlin.String? = null, + private var url: kotlin.String? = null, + private var title: kotlin.String? = null + ) { + fun type(type: kotlin.String) = apply { this.type = type } + + fun propertySize(propertySize: kotlin.String) = apply { this.propertySize = propertySize } + + fun url(url: kotlin.String) = apply { this.url = url } + + fun title(title: kotlin.String?) = apply { this.title = title } + + fun build(): ActivitiesMedia { + val instance = + ActivitiesMedia( + type = type!!, + propertySize = propertySize!!, + url = url!!, + title = title + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesMedia) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + type = type!!, + propertySize = propertySize!!, + url = url!!, + title = title + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt new file mode 100644 index 00000000..524a014e --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Container for the discount amount. + * @param `value` The value of the element being defined. + * @param currency The ISO 4217 Currency Code that the value is expressed in. + * @param localCurrencyPrice + */ +data class ActivitiesMoney( + // The value of the element being defined. + @JsonProperty("Value") + @field:NotNull + @field:Valid + val `value`: kotlin.String, + // The ISO 4217 Currency Code that the value is expressed in. + @JsonProperty("Currency") + @field:NotNull + @field:Valid + val currency: kotlin.String, + @JsonProperty("LocalCurrencyPrice") + @field:Valid + val localCurrencyPrice: ActivitiesMoney? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var `value`: kotlin.String? = null, + private var currency: kotlin.String? = null, + private var localCurrencyPrice: ActivitiesMoney? = null + ) { + fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } + + fun currency(currency: kotlin.String) = apply { this.currency = currency } + + fun localCurrencyPrice(localCurrencyPrice: ActivitiesMoney?) = apply { this.localCurrencyPrice = localCurrencyPrice } + + fun build(): ActivitiesMoney { + val instance = + ActivitiesMoney( + `value` = `value`!!, + currency = currency!!, + localCurrencyPrice = localCurrencyPrice + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesMoney) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + `value` = `value`!!, + currency = currency!!, + localCurrencyPrice = localCurrencyPrice + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt new file mode 100644 index 00000000..a7cec9c1 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Geography entities which are typically contained within a city. This includes the categories neighborhood and point of interest. Low level regions are not a formally defined concept in the geography model. + * @param id Neighborhood id. + * @param name Neighborhood name. + */ +data class ActivitiesNeighborhood( + // Neighborhood id. + @JsonProperty("Id") + @field:NotNull + @field:Valid + val id: kotlin.String, + // Neighborhood name. + @JsonProperty("Name") + @field:NotNull + @field:Valid + val name: kotlin.String +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var id: kotlin.String? = null, + private var name: kotlin.String? = null + ) { + fun id(id: kotlin.String) = apply { this.id = id } + + fun name(name: kotlin.String) = apply { this.name = name } + + fun build(): ActivitiesNeighborhood { + val instance = + ActivitiesNeighborhood( + id = id!!, + name = name!! + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesNeighborhood) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + id = id!!, + name = name!! + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt new file mode 100644 index 00000000..8af792ad --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * The phone of the company providing the activity. + * @param countryCode Country code of traveler's phone number; only digits allowed. + * @param number Traveler's phone number; only digits allowed. + * @param areaCode Area code of traveler's phone number; only digits allowed. + * @param extensionNumber + */ +data class ActivitiesPhone( + // Country code of traveler's phone number; only digits allowed. + @JsonProperty("CountryCode") + @field:NotNull + @field:Valid + val countryCode: kotlin.String, + // Traveler's phone number; only digits allowed. + @JsonProperty("Number") + @field:NotNull + @field:Valid + val number: kotlin.String, + // Area code of traveler's phone number; only digits allowed. + @JsonProperty("AreaCode") + @field:Valid + val areaCode: kotlin.String? = null, + @JsonProperty("ExtensionNumber") + @field:Valid + val extensionNumber: kotlin.String? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var countryCode: kotlin.String? = null, + private var number: kotlin.String? = null, + private var areaCode: kotlin.String? = null, + private var extensionNumber: kotlin.String? = null + ) { + fun countryCode(countryCode: kotlin.String) = apply { this.countryCode = countryCode } + + fun number(number: kotlin.String) = apply { this.number = number } + + fun areaCode(areaCode: kotlin.String?) = apply { this.areaCode = areaCode } + + fun extensionNumber(extensionNumber: kotlin.String?) = apply { this.extensionNumber = extensionNumber } + + fun build(): ActivitiesPhone { + val instance = + ActivitiesPhone( + countryCode = countryCode!!, + number = number!!, + areaCode = areaCode, + extensionNumber = extensionNumber + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesPhone) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + countryCode = countryCode!!, + number = number!!, + areaCode = areaCode, + extensionNumber = extensionNumber + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt new file mode 100644 index 00000000..7e469e3c --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesMoney +import com.expediagroup.sdk.xap.models.ReferencePrice +import com.expediagroup.sdk.xap.models.Savings +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * The price of the offer + * @param totalRate + * @param category Type of passenger. Values supported are: ADULT | SENIOR | CHILD + * @param totalFees + * @param totalTaxesAndFees + * @param referencePrice + * @param savings + */ +data class ActivitiesPrice( + @JsonProperty("TotalRate") + @field:NotNull + @field:Valid + val totalRate: ActivitiesMoney, + // Type of passenger. Values supported are: ADULT | SENIOR | CHILD + @JsonProperty("Category") + @field:Valid + val category: kotlin.String? = null, + @JsonProperty("TotalFees") + @field:Valid + val totalFees: ActivitiesMoney? = null, + @JsonProperty("TotalTaxesAndFees") + @field:Valid + val totalTaxesAndFees: ActivitiesMoney? = null, + @JsonProperty("ReferencePrice") + @field:Valid + val referencePrice: ReferencePrice? = null, + @JsonProperty("Savings") + @field:Valid + val savings: Savings? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var totalRate: ActivitiesMoney? = null, + private var category: kotlin.String? = null, + private var totalFees: ActivitiesMoney? = null, + private var totalTaxesAndFees: ActivitiesMoney? = null, + private var referencePrice: ReferencePrice? = null, + private var savings: Savings? = null + ) { + fun totalRate(totalRate: ActivitiesMoney) = apply { this.totalRate = totalRate } + + fun category(category: kotlin.String?) = apply { this.category = category } + + fun totalFees(totalFees: ActivitiesMoney?) = apply { this.totalFees = totalFees } + + fun totalTaxesAndFees(totalTaxesAndFees: ActivitiesMoney?) = apply { this.totalTaxesAndFees = totalTaxesAndFees } + + fun referencePrice(referencePrice: ReferencePrice?) = apply { this.referencePrice = referencePrice } + + fun savings(savings: Savings?) = apply { this.savings = savings } + + fun build(): ActivitiesPrice { + val instance = + ActivitiesPrice( + totalRate = totalRate!!, + category = category, + totalFees = totalFees, + totalTaxesAndFees = totalTaxesAndFees, + referencePrice = referencePrice, + savings = savings + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesPrice) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + totalRate = totalRate!!, + category = category, + totalFees = totalFees, + totalTaxesAndFees = totalTaxesAndFees, + referencePrice = referencePrice, + savings = savings + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt new file mode 100644 index 00000000..2a5297ce --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesPhone +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * The details information of company providing the activity. + * @param name The name of the company providing the activity. + * @param phone + */ +data class ActivitiesSupplier( + // The name of the company providing the activity. + @JsonProperty("Name") + @field:NotNull + @field:Valid + val name: kotlin.String, + @JsonProperty("Phone") + @field:Valid + val phone: ActivitiesPhone? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var name: kotlin.String? = null, + private var phone: ActivitiesPhone? = null + ) { + fun name(name: kotlin.String) = apply { this.name = name } + + fun phone(phone: ActivitiesPhone?) = apply { this.phone = phone } + + fun build(): ActivitiesSupplier { + val instance = + ActivitiesSupplier( + name = name!!, + phone = phone + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesSupplier) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + name = name!!, + phone = phone + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt new file mode 100644 index 00000000..71c3fae0 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt @@ -0,0 +1,154 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesLink +import com.expediagroup.sdk.xap.models.ActivitiesMoney +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Container for all warnings generated during the transaction. + * @param code Standardized warning code. + * @param description Standardized warning description message. + * @param originalPrice + * @param newPrice + * @param changedAmount + * @param changedPercentage The changed percentage. In the sample 2.97 means the changed percentage is 2.97%. + * @param links + */ +data class ActivitiesWarning( + // Standardized warning code. + @JsonProperty("Code") + @field:NotNull + @field:Valid + val code: kotlin.String, + // Standardized warning description message. + @JsonProperty("Description") + @field:NotNull + @field:Valid + val description: kotlin.String, + @JsonProperty("OriginalPrice") + @field:Valid + val originalPrice: ActivitiesMoney? = null, + @JsonProperty("NewPrice") + @field:Valid + val newPrice: ActivitiesMoney? = null, + @JsonProperty("ChangedAmount") + @field:Valid + val changedAmount: ActivitiesMoney? = null, + // The changed percentage. In the sample 2.97 means the changed percentage is 2.97%. + @JsonProperty("ChangedPercentage") + @field:Valid + val changedPercentage: kotlin.String? = null, + @JsonProperty("Links") + @field:Valid + val links: kotlin.collections.Map? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var code: kotlin.String? = null, + private var description: kotlin.String? = null, + private var originalPrice: ActivitiesMoney? = null, + private var newPrice: ActivitiesMoney? = null, + private var changedAmount: ActivitiesMoney? = null, + private var changedPercentage: kotlin.String? = null, + private var links: kotlin.collections.Map? = null + ) { + fun code(code: kotlin.String) = apply { this.code = code } + + fun description(description: kotlin.String) = apply { this.description = description } + + fun originalPrice(originalPrice: ActivitiesMoney?) = apply { this.originalPrice = originalPrice } + + fun newPrice(newPrice: ActivitiesMoney?) = apply { this.newPrice = newPrice } + + fun changedAmount(changedAmount: ActivitiesMoney?) = apply { this.changedAmount = changedAmount } + + fun changedPercentage(changedPercentage: kotlin.String?) = apply { this.changedPercentage = changedPercentage } + + fun links(links: kotlin.collections.Map?) = apply { this.links = links } + + fun build(): ActivitiesWarning { + val instance = + ActivitiesWarning( + code = code!!, + description = description!!, + originalPrice = originalPrice, + newPrice = newPrice, + changedAmount = changedAmount, + changedPercentage = changedPercentage, + links = links + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivitiesWarning) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + code = code!!, + description = description!!, + originalPrice = originalPrice, + newPrice = newPrice, + changedAmount = changedAmount, + changedPercentage = changedPercentage, + links = links + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt new file mode 100644 index 00000000..420114d7 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt @@ -0,0 +1,319 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesCancellationPolicy +import com.expediagroup.sdk.xap.models.ActivitiesLink +import com.expediagroup.sdk.xap.models.ActivitiesLocation +import com.expediagroup.sdk.xap.models.ActivitiesMedia +import com.expediagroup.sdk.xap.models.ActivitiesPrice +import com.expediagroup.sdk.xap.models.ActivitiesSupplier +import com.expediagroup.sdk.xap.models.Offer +import com.expediagroup.sdk.xap.models.Redemption +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Detailed information on the Activity. + * @param id The numerical identifier for this particular activity + * @param title The display title for this activity. + * @param description The description of the Activity. + * @param media List of activity Media. + * @param categories A list of the Activity categories to which this particular activity belongs. Possible values are: Adventures Air, Balloon & Helicopter Tours Attractions Cruises & Water Tours Day Trips & Excursions Food & Drink Hop-on Hop-off Multi-Day & Extended Tours Nightlife Private Tours Private Transfers Shared Transfers Show & Sport Tickets Sightseeing Passes Theme Parks Tours & Sightseeing Walking & Bike Tours Water Activities Wedding Ceremonies Winter Activities + * @param duration The anticipated time duration for the activity. Using java jdk Duration parsing. + * @param freeCancellation A boolean value describing whether or not this activity reservation can be cancelled without incurring a penalty. + * @param price + * @param supplier + * @param redemption + * @param activityLocations Container of location information where activity happens. + * @param reviewScore The overall Expedia score for the activity. + * @param reviewCount The number of Expedia reviews that went into the calculation of the ReviewScore. + * @param links HATEOAS links included in this response. + * @param cancellationPolicy + * @param highlights Web formatted statement of the Highlight(s) for the activity. + * @param termsAndConditions Terms and Conditions for the Activity. + * @param inclusions Web formatted statement of what is included in the activity + * @param exclusions Web formatted statement of what is NOT included in the activity + * @param knowBeforeYouBook Web formatted statement of things that a purchaser should be aware of BEFORE they book this activity. + * @param knowBeforeYouGo Web formatted statement of things that a purchaser should be aware of BEFORE they go to this activity. + * @param offers Offers for the activity. + */ +data class Activity( + // The numerical identifier for this particular activity + @JsonProperty("Id") + val id: kotlin.Int, + // The display title for this activity. + @JsonProperty("Title") + @field:NotNull + @field:Valid + val title: kotlin.String, + // The description of the Activity. + @JsonProperty("Description") + @field:NotNull + @field:Valid + val description: kotlin.String, + // List of activity Media. + @JsonProperty("Media") + @field:NotNull + @field:Valid + val media: kotlin.collections + .List< + ActivitiesMedia + >, + // A list of the Activity categories to which this particular activity belongs. Possible values are: Adventures Air, Balloon & Helicopter Tours Attractions Cruises & Water Tours Day Trips & Excursions Food & Drink Hop-on Hop-off Multi-Day & Extended Tours Nightlife Private Tours Private Transfers Shared Transfers Show & Sport Tickets Sightseeing Passes Theme Parks Tours & Sightseeing Walking & Bike Tours Water Activities Wedding Ceremonies Winter Activities + @JsonProperty("Categories") + @field:NotNull + @field:Valid + val categories: kotlin.collections + .List< + kotlin.String + >, + // The anticipated time duration for the activity. Using java jdk Duration parsing. + @JsonProperty("Duration") + @field:NotNull + @field:Valid + val duration: kotlin.String, + // A boolean value describing whether or not this activity reservation can be cancelled without incurring a penalty. + @JsonProperty("FreeCancellation") + @field:NotNull + @field:Valid + val freeCancellation: kotlin.Boolean, + @JsonProperty("Price") + @field:NotNull + @field:Valid + val price: ActivitiesPrice, + @JsonProperty("Supplier") + @field:NotNull + @field:Valid + val supplier: ActivitiesSupplier, + @JsonProperty("Redemption") + @field:Valid + val redemption: Redemption? = null, + // Container of location information where activity happens. + @JsonProperty("ActivityLocations") + @field:Valid + val activityLocations: kotlin.collections.List? = null, + // The overall Expedia score for the activity. + @JsonProperty("ReviewScore") + val reviewScore: kotlin.Int? = null, + // The number of Expedia reviews that went into the calculation of the ReviewScore. + @JsonProperty("ReviewCount") + val reviewCount: kotlin.Int? = null, + // HATEOAS links included in this response. + @JsonProperty("Links") + @field:Valid + val links: kotlin.collections.Map? = null, + @JsonProperty("CancellationPolicy") + @field:Valid + val cancellationPolicy: ActivitiesCancellationPolicy? = null, + // Web formatted statement of the Highlight(s) for the activity. + @JsonProperty("Highlights") + @field:Valid + val highlights: kotlin.collections.List? = null, + // Terms and Conditions for the Activity. + @JsonProperty("TermsAndConditions") + @field:Valid + val termsAndConditions: kotlin.collections.List? = null, + // Web formatted statement of what is included in the activity + @JsonProperty("Inclusions") + @field:Valid + val inclusions: kotlin.collections.List? = null, + // Web formatted statement of what is NOT included in the activity + @JsonProperty("Exclusions") + @field:Valid + val exclusions: kotlin.collections.List? = null, + // Web formatted statement of things that a purchaser should be aware of BEFORE they book this activity. + @JsonProperty("KnowBeforeYouBook") + @field:Valid + val knowBeforeYouBook: kotlin.collections.List? = null, + // Web formatted statement of things that a purchaser should be aware of BEFORE they go to this activity. + @JsonProperty("KnowBeforeYouGo") + @field:Valid + val knowBeforeYouGo: kotlin.collections.List? = null, + // Offers for the activity. + @JsonProperty("Offers") + @field:Valid + val offers: kotlin.collections.List? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var id: kotlin.Int? = null, + private var title: kotlin.String? = null, + private var description: kotlin.String? = null, + private var media: kotlin.collections.List? = null, + private var categories: kotlin.collections.List? = null, + private var duration: kotlin.String? = null, + private var freeCancellation: kotlin.Boolean? = null, + private var price: ActivitiesPrice? = null, + private var supplier: ActivitiesSupplier? = null, + private var redemption: Redemption? = null, + private var activityLocations: kotlin.collections.List? = null, + private var reviewScore: kotlin.Int? = null, + private var reviewCount: kotlin.Int? = null, + private var links: kotlin.collections.Map? = null, + private var cancellationPolicy: ActivitiesCancellationPolicy? = null, + private var highlights: kotlin.collections.List? = null, + private var termsAndConditions: kotlin.collections.List? = null, + private var inclusions: kotlin.collections.List? = null, + private var exclusions: kotlin.collections.List? = null, + private var knowBeforeYouBook: kotlin.collections.List? = null, + private var knowBeforeYouGo: kotlin.collections.List? = null, + private var offers: kotlin.collections.List? = null + ) { + fun id(id: kotlin.Int) = apply { this.id = id } + + fun title(title: kotlin.String) = apply { this.title = title } + + fun description(description: kotlin.String) = apply { this.description = description } + + fun media(media: kotlin.collections.List) = apply { this.media = media } + + fun categories(categories: kotlin.collections.List) = apply { this.categories = categories } + + fun duration(duration: kotlin.String) = apply { this.duration = duration } + + fun freeCancellation(freeCancellation: kotlin.Boolean) = apply { this.freeCancellation = freeCancellation } + + fun price(price: ActivitiesPrice) = apply { this.price = price } + + fun supplier(supplier: ActivitiesSupplier) = apply { this.supplier = supplier } + + fun redemption(redemption: Redemption?) = apply { this.redemption = redemption } + + fun activityLocations(activityLocations: kotlin.collections.List?) = apply { this.activityLocations = activityLocations } + + fun reviewScore(reviewScore: kotlin.Int?) = apply { this.reviewScore = reviewScore } + + fun reviewCount(reviewCount: kotlin.Int?) = apply { this.reviewCount = reviewCount } + + fun links(links: kotlin.collections.Map?) = apply { this.links = links } + + fun cancellationPolicy(cancellationPolicy: ActivitiesCancellationPolicy?) = apply { this.cancellationPolicy = cancellationPolicy } + + fun highlights(highlights: kotlin.collections.List?) = apply { this.highlights = highlights } + + fun termsAndConditions(termsAndConditions: kotlin.collections.List?) = apply { this.termsAndConditions = termsAndConditions } + + fun inclusions(inclusions: kotlin.collections.List?) = apply { this.inclusions = inclusions } + + fun exclusions(exclusions: kotlin.collections.List?) = apply { this.exclusions = exclusions } + + fun knowBeforeYouBook(knowBeforeYouBook: kotlin.collections.List?) = apply { this.knowBeforeYouBook = knowBeforeYouBook } + + fun knowBeforeYouGo(knowBeforeYouGo: kotlin.collections.List?) = apply { this.knowBeforeYouGo = knowBeforeYouGo } + + fun offers(offers: kotlin.collections.List?) = apply { this.offers = offers } + + fun build(): Activity { + val instance = + Activity( + id = id!!, + title = title!!, + description = description!!, + media = media!!, + categories = categories!!, + duration = duration!!, + freeCancellation = freeCancellation!!, + price = price!!, + supplier = supplier!!, + redemption = redemption, + activityLocations = activityLocations, + reviewScore = reviewScore, + reviewCount = reviewCount, + links = links, + cancellationPolicy = cancellationPolicy, + highlights = highlights, + termsAndConditions = termsAndConditions, + inclusions = inclusions, + exclusions = exclusions, + knowBeforeYouBook = knowBeforeYouBook, + knowBeforeYouGo = knowBeforeYouGo, + offers = offers + ) + + validate(instance) + + return instance + } + + private fun validate(instance: Activity) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + id = id!!, + title = title!!, + description = description!!, + media = media!!, + categories = categories!!, + duration = duration!!, + freeCancellation = freeCancellation!!, + price = price!!, + supplier = supplier!!, + redemption = redemption, + activityLocations = activityLocations, + reviewScore = reviewScore, + reviewCount = reviewCount, + links = links, + cancellationPolicy = cancellationPolicy, + highlights = highlights, + termsAndConditions = termsAndConditions, + inclusions = inclusions, + exclusions = exclusions, + knowBeforeYouBook = knowBeforeYouBook, + knowBeforeYouGo = knowBeforeYouGo, + offers = offers + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt new file mode 100644 index 00000000..337bba6f --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesWarning +import com.expediagroup.sdk.xap.models.Activity +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * + * @param transactionId A unique identifier for this transaction. + * @param location The location user searched, translated into the full, unambiguous format. + * @param warnings Container for all warnings generated during the transaction. + * @param startDate The startDate of activities in YYY-MM-DD format. + * @param endDate The endDate of activities in YYY-MM-DD format. + * @param activityDetails + */ +data class ActivityDetailsResponse( + // A unique identifier for this transaction. + @JsonProperty("TransactionId") + @field:NotNull + @field:Valid + val transactionId: kotlin.String, + // The location user searched, translated into the full, unambiguous format. + @JsonProperty("Location") + @field:NotNull + @field:Valid + val location: kotlin.String, + // Container for all warnings generated during the transaction. + @JsonProperty("Warnings") + @field:Valid + val warnings: kotlin.collections.List? = null, + // The startDate of activities in YYY-MM-DD format. + @JsonProperty("StartDate") + val startDate: java.time.LocalDate? = null, + // The endDate of activities in YYY-MM-DD format. + @JsonProperty("EndDate") + val endDate: java.time.LocalDate? = null, + @JsonProperty("ActivityDetails") + @field:Valid + val activityDetails: Activity? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var transactionId: kotlin.String? = null, + private var location: kotlin.String? = null, + private var warnings: kotlin.collections.List? = null, + private var startDate: java.time.LocalDate? = null, + private var endDate: java.time.LocalDate? = null, + private var activityDetails: Activity? = null + ) { + fun transactionId(transactionId: kotlin.String) = apply { this.transactionId = transactionId } + + fun location(location: kotlin.String) = apply { this.location = location } + + fun warnings(warnings: kotlin.collections.List?) = apply { this.warnings = warnings } + + fun startDate(startDate: java.time.LocalDate?) = apply { this.startDate = startDate } + + fun endDate(endDate: java.time.LocalDate?) = apply { this.endDate = endDate } + + fun activityDetails(activityDetails: Activity?) = apply { this.activityDetails = activityDetails } + + fun build(): ActivityDetailsResponse { + val instance = + ActivityDetailsResponse( + transactionId = transactionId!!, + location = location!!, + warnings = warnings, + startDate = startDate, + endDate = endDate, + activityDetails = activityDetails + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivityDetailsResponse) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + transactionId = transactionId!!, + location = location!!, + warnings = warnings, + startDate = startDate, + endDate = endDate, + activityDetails = activityDetails + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt new file mode 100644 index 00000000..79cbaf46 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesWarning +import com.expediagroup.sdk.xap.models.Activity +import com.expediagroup.sdk.xap.models.CategoryGroup +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * + * @param transactionId A unique identifier for this transaction. + * @param count The number of activities returned in the response. + * @param location The location that the user searched, expressed in the exact format that the inventory system uses to designate the location. + * @param warnings Container for all warnings generated during the transaction. + * @param startDate The startDate of the returned group of activities in YYYY-MM-DD format. + * @param endDate The endDate of returned group of activities in YYYY-MM-DD format. + * @param activities List of activities matching the search criteria. + * @param categories Container for a breakdown of how many of each type of Activity have been returned in the API response. + */ +data class ActivityListingsResponse( + // A unique identifier for this transaction. + @JsonProperty("TransactionId") + @field:NotNull + @field:Valid + val transactionId: kotlin.String, + // The number of activities returned in the response. + @JsonProperty("Count") + val count: kotlin.Long, + // The location that the user searched, expressed in the exact format that the inventory system uses to designate the location. + @JsonProperty("Location") + @field:NotNull + @field:Valid + val location: kotlin.String, + // Container for all warnings generated during the transaction. + @JsonProperty("Warnings") + @field:Valid + val warnings: kotlin.collections.List? = null, + // The startDate of the returned group of activities in YYYY-MM-DD format. + @JsonProperty("StartDate") + val startDate: java.time.LocalDate? = null, + // The endDate of returned group of activities in YYYY-MM-DD format. + @JsonProperty("EndDate") + val endDate: java.time.LocalDate? = null, + // List of activities matching the search criteria. + @JsonProperty("Activities") + @field:Valid + val activities: kotlin.collections.List? = null, + // Container for a breakdown of how many of each type of Activity have been returned in the API response. + @JsonProperty("Categories") + @field:Valid + val categories: kotlin.collections.List? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var transactionId: kotlin.String? = null, + private var count: kotlin.Long? = null, + private var location: kotlin.String? = null, + private var warnings: kotlin.collections.List? = null, + private var startDate: java.time.LocalDate? = null, + private var endDate: java.time.LocalDate? = null, + private var activities: kotlin.collections.List? = null, + private var categories: kotlin.collections.List? = null + ) { + fun transactionId(transactionId: kotlin.String) = apply { this.transactionId = transactionId } + + fun count(count: kotlin.Long) = apply { this.count = count } + + fun location(location: kotlin.String) = apply { this.location = location } + + fun warnings(warnings: kotlin.collections.List?) = apply { this.warnings = warnings } + + fun startDate(startDate: java.time.LocalDate?) = apply { this.startDate = startDate } + + fun endDate(endDate: java.time.LocalDate?) = apply { this.endDate = endDate } + + fun activities(activities: kotlin.collections.List?) = apply { this.activities = activities } + + fun categories(categories: kotlin.collections.List?) = apply { this.categories = categories } + + fun build(): ActivityListingsResponse { + val instance = + ActivityListingsResponse( + transactionId = transactionId!!, + count = count!!, + location = location!!, + warnings = warnings, + startDate = startDate, + endDate = endDate, + activities = activities, + categories = categories + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ActivityListingsResponse) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + transactionId = transactionId!!, + count = count!!, + location = location!!, + warnings = warnings, + startDate = startDate, + endDate = endDate, + activities = activities, + categories = categories + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt new file mode 100644 index 00000000..31d96f56 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesCancellationPolicy +import com.expediagroup.sdk.xap.models.Ticket +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * The list of available Time Slots for the activity. + * @param dateTime The date and time when the activity happens. + * @param allDayActivity Indicates whether the activity is an all-day activity. + * @param cancellationPolicy + * @param tickets Container for ticket information. + */ +data class AvailableTimeSlot( + // The date and time when the activity happens. + @JsonProperty("DateTime") + val dateTime: java.time.LocalDateTime, + // Indicates whether the activity is an all-day activity. + @JsonProperty("AllDayActivity") + @field:NotNull + @field:Valid + val allDayActivity: kotlin.Boolean, + @JsonProperty("CancellationPolicy") + @field:NotNull + @field:Valid + val cancellationPolicy: ActivitiesCancellationPolicy, + // Container for ticket information. + @JsonProperty("Tickets") + @field:NotNull + @field:Valid + val tickets: kotlin.collections + .List< + Ticket + > +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var dateTime: java.time.LocalDateTime? = null, + private var allDayActivity: kotlin.Boolean? = null, + private var cancellationPolicy: ActivitiesCancellationPolicy? = null, + private var tickets: kotlin.collections.List? = null + ) { + fun dateTime(dateTime: java.time.LocalDateTime) = apply { this.dateTime = dateTime } + + fun allDayActivity(allDayActivity: kotlin.Boolean) = apply { this.allDayActivity = allDayActivity } + + fun cancellationPolicy(cancellationPolicy: ActivitiesCancellationPolicy) = apply { this.cancellationPolicy = cancellationPolicy } + + fun tickets(tickets: kotlin.collections.List) = apply { this.tickets = tickets } + + fun build(): AvailableTimeSlot { + val instance = + AvailableTimeSlot( + dateTime = dateTime!!, + allDayActivity = allDayActivity!!, + cancellationPolicy = cancellationPolicy!!, + tickets = tickets!! + ) + + validate(instance) + + return instance + } + + private fun validate(instance: AvailableTimeSlot) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + dateTime = dateTime!!, + allDayActivity = allDayActivity!!, + cancellationPolicy = cancellationPolicy!!, + tickets = tickets!! + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt new file mode 100644 index 00000000..ec433a73 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Container for a breakdown of how many of each type of Activity have been returned in the API response. + * @param count The count of the number of categories the returned set of activities map to. + * @param groupName The group which the category belongs Possible value is: Recommendations Tours Activities Transportation Promotions Duration + * @param groupDisplayName The localized value for category name. + * @param categoryName The name of one of the categories. + * @param categoryDisplayName + */ +data class CategoryGroup( + // The count of the number of categories the returned set of activities map to. + @JsonProperty("Count") + val count: kotlin.Int, + // The group which the category belongs Possible value is: Recommendations Tours Activities Transportation Promotions Duration + @JsonProperty("GroupName") + @field:NotNull + @field:Valid + val groupName: kotlin.String, + // The localized value for category name. + @JsonProperty("GroupDisplayName") + @field:NotNull + @field:Valid + val groupDisplayName: kotlin.String, + // The name of one of the categories. + @JsonProperty("CategoryName") + @field:NotNull + @field:Valid + val categoryName: kotlin.String, + @JsonProperty("CategoryDisplayName") + @field:Valid + val categoryDisplayName: kotlin.String? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var count: kotlin.Int? = null, + private var groupName: kotlin.String? = null, + private var groupDisplayName: kotlin.String? = null, + private var categoryName: kotlin.String? = null, + private var categoryDisplayName: kotlin.String? = null + ) { + fun count(count: kotlin.Int) = apply { this.count = count } + + fun groupName(groupName: kotlin.String) = apply { this.groupName = groupName } + + fun groupDisplayName(groupDisplayName: kotlin.String) = apply { this.groupDisplayName = groupDisplayName } + + fun categoryName(categoryName: kotlin.String) = apply { this.categoryName = categoryName } + + fun categoryDisplayName(categoryDisplayName: kotlin.String?) = apply { this.categoryDisplayName = categoryDisplayName } + + fun build(): CategoryGroup { + val instance = + CategoryGroup( + count = count!!, + groupName = groupName!!, + groupDisplayName = groupDisplayName!!, + categoryName = categoryName!!, + categoryDisplayName = categoryDisplayName + ) + + validate(instance) + + return instance + } + + private fun validate(instance: CategoryGroup) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + count = count!!, + groupName = groupName!!, + groupDisplayName = groupDisplayName!!, + categoryName = categoryName!!, + categoryDisplayName = categoryDisplayName + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt new file mode 100644 index 00000000..eb1e0055 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesLink +import com.expediagroup.sdk.xap.models.ActivitiesPrice +import com.expediagroup.sdk.xap.models.AvailableTimeSlot +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Offers for the activity. + * @param id The numerical identifier for the offer. + * @param title A descriptive title for this offer. + * @param duration The anticipated time duration for the activity, e xpressed using Java JDK duration format. + * @param availableTimeSlots The list of available Time Slots for the activity. + * @param offerPrice + * @param description Description of this offer. + * @param links Container of HATEOAS URL's + */ +data class Offer( + // The numerical identifier for the offer. + @JsonProperty("Id") + val id: kotlin.Int, + // A descriptive title for this offer. + @JsonProperty("Title") + @field:NotNull + @field:Valid + val title: kotlin.String, + // The anticipated time duration for the activity, e xpressed using Java JDK duration format. + @JsonProperty("Duration") + @field:NotNull + @field:Valid + val duration: kotlin.String, + // The list of available Time Slots for the activity. + @JsonProperty("AvailableTimeSlots") + @field:NotNull + @field:Valid + val availableTimeSlots: kotlin.collections + .List< + AvailableTimeSlot + >, + @JsonProperty("OfferPrice") + @field:NotNull + @field:Valid + val offerPrice: ActivitiesPrice, + // Description of this offer. + @JsonProperty("Description") + @field:Valid + val description: kotlin.String? = null, + // Container of HATEOAS URL's + @JsonProperty("Links") + @field:Valid + val links: kotlin.collections.Map? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var id: kotlin.Int? = null, + private var title: kotlin.String? = null, + private var duration: kotlin.String? = null, + private var availableTimeSlots: kotlin.collections.List? = null, + private var offerPrice: ActivitiesPrice? = null, + private var description: kotlin.String? = null, + private var links: kotlin.collections.Map? = null + ) { + fun id(id: kotlin.Int) = apply { this.id = id } + + fun title(title: kotlin.String) = apply { this.title = title } + + fun duration(duration: kotlin.String) = apply { this.duration = duration } + + fun availableTimeSlots(availableTimeSlots: kotlin.collections.List) = apply { this.availableTimeSlots = availableTimeSlots } + + fun offerPrice(offerPrice: ActivitiesPrice) = apply { this.offerPrice = offerPrice } + + fun description(description: kotlin.String?) = apply { this.description = description } + + fun links(links: kotlin.collections.Map?) = apply { this.links = links } + + fun build(): Offer { + val instance = + Offer( + id = id!!, + title = title!!, + duration = duration!!, + availableTimeSlots = availableTimeSlots!!, + offerPrice = offerPrice!!, + description = description, + links = links + ) + + validate(instance) + + return instance + } + + private fun validate(instance: Offer) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + id = id!!, + title = title!!, + duration = duration!!, + availableTimeSlots = availableTimeSlots!!, + offerPrice = offerPrice!!, + description = description, + links = links + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt new file mode 100644 index 00000000..32a02d01 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesLocation +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation + +/** + * Container of redemption information. + * @param type The type of redemption process associated to the activity. + * @param redemptionLocations List of redemption locations where the activity will take place, please refer to Location Section below. + */ +data class Redemption( + // The type of redemption process associated to the activity. + @JsonProperty("Type") + @field:Valid + val type: kotlin.String? = null, + // List of redemption locations where the activity will take place, please refer to Location Section below. + @JsonProperty("RedemptionLocations") + @field:Valid + val redemptionLocations: kotlin.collections.List? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var type: kotlin.String? = null, + private var redemptionLocations: kotlin.collections.List? = null + ) { + fun type(type: kotlin.String?) = apply { this.type = type } + + fun redemptionLocations(redemptionLocations: kotlin.collections.List?) = apply { this.redemptionLocations = redemptionLocations } + + fun build(): Redemption { + val instance = + Redemption( + type = type, + redemptionLocations = redemptionLocations + ) + + validate(instance) + + return instance + } + + private fun validate(instance: Redemption) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + type = type, + redemptionLocations = redemptionLocations + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt new file mode 100644 index 00000000..8657fc46 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesMoney +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Container for the reference price used for strike out display. + * @param totalRate + * @param totalFees + * @param totalTaxesAndFees + */ +data class ReferencePrice( + @JsonProperty("TotalRate") + @field:NotNull + @field:Valid + val totalRate: ActivitiesMoney, + @JsonProperty("TotalFees") + @field:Valid + val totalFees: ActivitiesMoney? = null, + @JsonProperty("TotalTaxesAndFees") + @field:Valid + val totalTaxesAndFees: ActivitiesMoney? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var totalRate: ActivitiesMoney? = null, + private var totalFees: ActivitiesMoney? = null, + private var totalTaxesAndFees: ActivitiesMoney? = null + ) { + fun totalRate(totalRate: ActivitiesMoney) = apply { this.totalRate = totalRate } + + fun totalFees(totalFees: ActivitiesMoney?) = apply { this.totalFees = totalFees } + + fun totalTaxesAndFees(totalTaxesAndFees: ActivitiesMoney?) = apply { this.totalTaxesAndFees = totalTaxesAndFees } + + fun build(): ReferencePrice { + val instance = + ReferencePrice( + totalRate = totalRate!!, + totalFees = totalFees, + totalTaxesAndFees = totalTaxesAndFees + ) + + validate(instance) + + return instance + } + + private fun validate(instance: ReferencePrice) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + totalRate = totalRate!!, + totalFees = totalFees, + totalTaxesAndFees = totalTaxesAndFees + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt new file mode 100644 index 00000000..e442400b --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Container of the Restrictions associated to this ticket. + * @param type Type of the Restriction. + * @param max Maximum value allowed for the restriction type. + * @param min Minimum value allowed for the restriction type. + * @param description The text to describe the restriction. + */ +data class Restrictions( + // Type of the Restriction. + @JsonProperty("Type") + @field:NotNull + @field:Valid + val type: kotlin.String, + // Maximum value allowed for the restriction type. + @JsonProperty("Max") + @field:NotNull + @field:Valid + val max: kotlin.String, + // Minimum value allowed for the restriction type. + @JsonProperty("Min") + @field:NotNull + @field:Valid + val min: kotlin.String, + // The text to describe the restriction. + @JsonProperty("Description") + @field:Valid + val description: kotlin.String? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var type: kotlin.String? = null, + private var max: kotlin.String? = null, + private var min: kotlin.String? = null, + private var description: kotlin.String? = null + ) { + fun type(type: kotlin.String) = apply { this.type = type } + + fun max(max: kotlin.String) = apply { this.max = max } + + fun min(min: kotlin.String) = apply { this.min = min } + + fun description(description: kotlin.String?) = apply { this.description = description } + + fun build(): Restrictions { + val instance = + Restrictions( + type = type!!, + max = max!!, + min = min!!, + description = description + ) + + validate(instance) + + return instance + } + + private fun validate(instance: Restrictions) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + type = type!!, + max = max!!, + min = min!!, + description = description + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt new file mode 100644 index 00000000..9282cb67 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesMoney +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * Container of savings information. + * @param percentage The percentage of the price that has been discounted off the regular price for the current activity. + * @param amount + */ +data class Savings( + // The percentage of the price that has been discounted off the regular price for the current activity. + @JsonProperty("Percentage") + val percentage: kotlin.Int, + @JsonProperty("Amount") + @field:NotNull + @field:Valid + val amount: ActivitiesMoney +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var percentage: kotlin.Int? = null, + private var amount: ActivitiesMoney? = null + ) { + fun percentage(percentage: kotlin.Int) = apply { this.percentage = percentage } + + fun amount(amount: ActivitiesMoney) = apply { this.amount = amount } + + fun build(): Savings { + val instance = + Savings( + percentage = percentage!!, + amount = amount!! + ) + + validate(instance) + + return instance + } + + private fun validate(instance: Savings) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + percentage = percentage!!, + amount = amount!! + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt new file mode 100644 index 00000000..741c82f2 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.models.ActivitiesPrice +import com.expediagroup.sdk.xap.models.Restrictions +import com.fasterxml.jackson.annotation.JsonProperty +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * The list of Ticket information. + * @param id The numerical identifier for the ticket. + * @param code The code for the ticket. Values supported are: Adult Traveler Child Group Senior Infant Student + * @param count The number of each ticket type to be booked. + * @param ticketPrice + * @param restrictions + */ +data class Ticket( + // The numerical identifier for the ticket. + @JsonProperty("Id") + val id: kotlin.Int, + // The code for the ticket. Values supported are: Adult Traveler Child Group Senior Infant Student + @JsonProperty("Code") + @field:NotNull + @field:Valid + val code: kotlin.String, + // The number of each ticket type to be booked. + @JsonProperty("Count") + val count: kotlin.Int, + @JsonProperty("TicketPrice") + @field:NotNull + @field:Valid + val ticketPrice: ActivitiesPrice, + @JsonProperty("Restrictions") + @field:Valid + val restrictions: Restrictions? = null +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var id: kotlin.Int? = null, + private var code: kotlin.String? = null, + private var count: kotlin.Int? = null, + private var ticketPrice: ActivitiesPrice? = null, + private var restrictions: Restrictions? = null + ) { + fun id(id: kotlin.Int) = apply { this.id = id } + + fun code(code: kotlin.String) = apply { this.code = code } + + fun count(count: kotlin.Int) = apply { this.count = count } + + fun ticketPrice(ticketPrice: ActivitiesPrice) = apply { this.ticketPrice = ticketPrice } + + fun restrictions(restrictions: Restrictions?) = apply { this.restrictions = restrictions } + + fun build(): Ticket { + val instance = + Ticket( + id = id!!, + code = code!!, + count = count!!, + ticketPrice = ticketPrice!!, + restrictions = restrictions + ) + + validate(instance) + + return instance + } + + private fun validate(instance: Ticket) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(instance) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + id = id!!, + code = code!!, + count = count!!, + ticketPrice = ticketPrice!!, + restrictions = restrictions + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/exception/ApiException.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/exception/ApiException.kt index 6a67cbdb..56dc289d 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/exception/ApiException.kt +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/exception/ApiException.kt @@ -64,6 +64,40 @@ internal object ErrorObjectMapper { private val defaultHttpStatusCodeRanges = listOf(DefaultHttpStatusCodeRange) private val httpStatusCodeRanges: Map> = mapOf( + Pair( + "getActivityDetails", + listOf( + HttpStatusCodeRange("400") { + ExpediaGroupApiActivitiesErrorsException(it.status.value, fetchErrorObject(it) as ActivitiesErrors, it.headers.getTransactionId()) + }, + HttpStatusCodeRange("401") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, + HttpStatusCodeRange("403") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, + HttpStatusCodeRange("404") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, + HttpStatusCodeRange("429") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, + HttpStatusCodeRange("500") { + ExpediaGroupApiActivitiesErrorsException(it.status.value, fetchErrorObject(it) as ActivitiesErrors, it.headers.getTransactionId()) + }, + HttpStatusCodeRange("503") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, + DefaultHttpStatusCodeRange + ) + ), + Pair( + "getActivityListings", + listOf( + HttpStatusCodeRange("400") { + ExpediaGroupApiActivitiesErrorsException(it.status.value, fetchErrorObject(it) as ActivitiesErrors, it.headers.getTransactionId()) + }, + HttpStatusCodeRange("401") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, + HttpStatusCodeRange("403") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, + HttpStatusCodeRange("404") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, + HttpStatusCodeRange("429") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, + HttpStatusCodeRange("500") { + ExpediaGroupApiActivitiesErrorsException(it.status.value, fetchErrorObject(it) as ActivitiesErrors, it.headers.getTransactionId()) + }, + HttpStatusCodeRange("503") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, + DefaultHttpStatusCodeRange + ) + ), Pair( "getCarDetails", listOf( @@ -238,10 +272,12 @@ internal object ErrorObjectMapper { } } -class ExpediaGroupApiCarsErrorsException(code: Int, override val errorObject: CarsErrors, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) +class ExpediaGroupApiActivitiesErrorsException(code: Int, override val errorObject: ActivitiesErrors, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) class ExpediaGroupApiAPIMErrorException(code: Int, override val errorObject: APIMError, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) +class ExpediaGroupApiCarsErrorsException(code: Int, override val errorObject: CarsErrors, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) + class ExpediaGroupApiPresignedUrlResponseException(code: Int, override val errorObject: PresignedUrlResponse, transactionId: String?) : ExpediaGroupApiException( code, errorObject, diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt new file mode 100644 index 00000000..ce545548 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.expediagroup.sdk.xap.operations + +import com.expediagroup.sdk.core.model.Nothing +import com.expediagroup.sdk.core.model.Operation +import org.apache.commons.text.StringSubstitutor + +/** + * + * @property params [GetActivityDetailsOperationParams] + */ +class GetActivityDetailsOperation( + params: GetActivityDetailsOperationParams +) : Operation< + Nothing + >( + url(params), + "GET", + "getActivityDetails", + null, + params + ) { + companion object { + fun url(params: GetActivityDetailsOperationParams): String { + val url = "/activities/details/{offerToken}" + val substitutor = StringSubstitutor(params.getPathParams(), "{", "}") + return substitutor.replace(url) + } + } +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt new file mode 100644 index 00000000..03f1b89b --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.expediagroup.sdk.xap.operations + +import com.expediagroup.sdk.core.model.OperationParams +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.infrastructure.* +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import io.ktor.http.Headers +import io.ktor.http.Parameters +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * @property offerToken the offerToken of a activity + * @property partnerTransactionId Partner-generated identifier. + * @property locale locale is composed of language identifier and region identifier, connected by \"_\" that specifies the language in which the response will be returned. example: \"fr_FR\" refers to French as spoken in France, while \"fr_CA\" refers to French as spoken in Canada. For a full list of supported locales please refer to the link at the bottom of the page. + */ +@JsonDeserialize(builder = GetActivityDetailsOperationParams.Builder::class) +data class GetActivityDetailsOperationParams( + @field:NotNull + @field:Valid + val offerToken: kotlin.String, + @field:NotNull + @field:Valid + val partnerTransactionId: kotlin.String, + @field:Valid + val locale: kotlin.String? = + null +) : OperationParams { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + @JsonProperty("offerToken") private var offerToken: kotlin.String? = null, + @JsonProperty("Partner-Transaction-Id") private var partnerTransactionId: kotlin.String? = null, + @JsonProperty("locale") private var locale: kotlin.String? = null + ) { + /** + * @param offerToken the offerToken of a activity + */ + fun offerToken(offerToken: kotlin.String) = apply { this.offerToken = offerToken } + + /** + * @param partnerTransactionId Partner-generated identifier. + */ + fun partnerTransactionId(partnerTransactionId: kotlin.String) = apply { this.partnerTransactionId = partnerTransactionId } + + /** + * @param locale locale is composed of language identifier and region identifier, connected by \"_\" that specifies the language in which the response will be returned. example: \"fr_FR\" refers to French as spoken in France, while \"fr_CA\" refers to French as spoken in Canada. For a full list of supported locales please refer to the link at the bottom of the page. + */ + fun locale(locale: kotlin.String) = apply { this.locale = locale } + + fun build(): GetActivityDetailsOperationParams { + val params = + GetActivityDetailsOperationParams( + offerToken = offerToken!!, + partnerTransactionId = partnerTransactionId!!, + locale = locale + ) + + validate(params) + + return params + } + + private fun validate(params: GetActivityDetailsOperationParams) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(params) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + offerToken = offerToken, + partnerTransactionId = partnerTransactionId, + locale = locale + ) + + override fun getHeaders(): Headers = + Headers.build { + partnerTransactionId?.let { + append("Partner-Transaction-Id", it) + } + append("Accept", "application/vnd.exp-activity.v3+json") + } + + override fun getQueryParams(): Parameters = + Parameters.build { + locale?.let { + append("locale", it) + } + } + + override fun getPathParams(): Map = + buildMap { + offerToken?.also { + put("offerToken", offerToken) + } + } +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt new file mode 100644 index 00000000..79578461 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.expediagroup.sdk.xap.operations + +import com.expediagroup.sdk.core.model.Nothing +import com.expediagroup.sdk.core.model.Operation + +/** + * + * @property params [GetActivityListingsOperationParams] + */ +class GetActivityListingsOperation( + params: GetActivityListingsOperationParams +) : Operation< + Nothing + >( + "/activities/listings", + "GET", + "getActivityListings", + null, + params + ) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt new file mode 100644 index 00000000..55bf5945 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2022 Expedia, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.expediagroup.sdk.xap.operations + +import com.expediagroup.sdk.core.model.OperationParams +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException +import com.expediagroup.sdk.xap.infrastructure.* +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import io.ktor.http.Headers +import io.ktor.http.Parameters +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator +import javax.validation.Valid +import javax.validation.Validation +import javax.validation.constraints.NotNull + +/** + * @property partnerTransactionId Partner-generated identifier. + * @property location Can be a city name, street address, three-letter IATA Airport Code or a landmark name. (If the value submitted does not clearly identify a single location the API may returne a disambiguation response that lists possible options) + * @property geoLocation The latitude and longitude values identifying the center point of a search radius (circle). North latitude will be represented by a positive value. South latitude by a negative value. East longitude will be represented by a positive value. West longitude by a negative value. The latitude and longitude values are joined together with a comma (,) character. + * @property startDate Start date for the activity window in YYY-MM-DD format. If an endDate value is supplied there must also be a startDate. default: currentDate + * @property endDate End date for the activity window in YYY-MM-DD format. default: \"startDate+14\" + * @property locale locale is composed of language identifier and region identifier, connected by \"_\" that specifies the language in which the response will be returned. example: \"fr_FR\" refers to French as spoken in France, while \"fr_CA\" refers to French as spoken in Canada. For a full list of supported locales please refer to the link at the bottom of the page. + * @property links Comma-separated list to specify the types of HATEAOS links returned in the API Response. WD (deep link URL to web infosite) AD (details API query) + */ +@JsonDeserialize(builder = GetActivityListingsOperationParams.Builder::class) +data class GetActivityListingsOperationParams( + @field:NotNull + @field:Valid + val partnerTransactionId: kotlin.String, + @field:Valid + val location: kotlin.String? = + null, + @field:Valid + val geoLocation: kotlin.String? = + null, + @field:Valid + val startDate: java.time.LocalDate? = + null, + @field:Valid + val endDate: java.time.LocalDate? = + null, + @field:Valid + val locale: kotlin.String? = + null, + val links: kotlin.collections.List< + GetActivityListingsOperationParams.Links + >? = + null +) : OperationParams { + companion object { + @JvmStatic + fun builder() = Builder() + } + + enum class Links( + val value: kotlin.String + ) { + WD("WD"), + AD("AD") + } + + class Builder( + @JsonProperty("Partner-Transaction-Id") private var partnerTransactionId: kotlin.String? = null, + @JsonProperty("location") private var location: kotlin.String? = null, + @JsonProperty("geoLocation") private var geoLocation: kotlin.String? = null, + @JsonProperty("startDate") private var startDate: java.time.LocalDate? = null, + @JsonProperty("endDate") private var endDate: java.time.LocalDate? = null, + @JsonProperty("locale") private var locale: kotlin.String? = null, + @JsonProperty("links") private var links: kotlin.collections.List< + GetActivityListingsOperationParams.Links + >? = null + ) { + /** + * @param partnerTransactionId Partner-generated identifier. + */ + fun partnerTransactionId(partnerTransactionId: kotlin.String) = apply { this.partnerTransactionId = partnerTransactionId } + + /** + * @param location Can be a city name, street address, three-letter IATA Airport Code or a landmark name. (If the value submitted does not clearly identify a single location the API may returne a disambiguation response that lists possible options) + */ + fun location(location: kotlin.String) = apply { this.location = location } + + /** + * @param geoLocation The latitude and longitude values identifying the center point of a search radius (circle). North latitude will be represented by a positive value. South latitude by a negative value. East longitude will be represented by a positive value. West longitude by a negative value. The latitude and longitude values are joined together with a comma (,) character. + */ + fun geoLocation(geoLocation: kotlin.String) = apply { this.geoLocation = geoLocation } + + /** + * @param startDate Start date for the activity window in YYY-MM-DD format. If an endDate value is supplied there must also be a startDate. default: currentDate + */ + fun startDate(startDate: java.time.LocalDate) = apply { this.startDate = startDate } + + /** + * @param endDate End date for the activity window in YYY-MM-DD format. default: \"startDate+14\" + */ + fun endDate(endDate: java.time.LocalDate) = apply { this.endDate = endDate } + + /** + * @param locale locale is composed of language identifier and region identifier, connected by \"_\" that specifies the language in which the response will be returned. example: \"fr_FR\" refers to French as spoken in France, while \"fr_CA\" refers to French as spoken in Canada. For a full list of supported locales please refer to the link at the bottom of the page. + */ + fun locale(locale: kotlin.String) = apply { this.locale = locale } + + /** + * @param links Comma-separated list to specify the types of HATEAOS links returned in the API Response. WD (deep link URL to web infosite) AD (details API query) + */ + fun links( + links: kotlin.collections.List< + GetActivityListingsOperationParams.Links + > + ) = apply { this.links = links } + + fun build(): GetActivityListingsOperationParams { + val params = + GetActivityListingsOperationParams( + partnerTransactionId = partnerTransactionId!!, + location = location, + geoLocation = geoLocation, + startDate = startDate, + endDate = endDate, + locale = locale, + links = links + ) + + validate(params) + + return params + } + + private fun validate(params: GetActivityListingsOperationParams) { + val validator = + Validation + .byDefaultProvider() + .configure() + .messageInterpolator(ParameterMessageInterpolator()) + .buildValidatorFactory() + .validator + + val violations = validator.validate(params) + + if (violations.isNotEmpty()) { + throw PropertyConstraintViolationException( + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } + ) + } + } + } + + fun toBuilder() = + Builder( + partnerTransactionId = partnerTransactionId, + location = location, + geoLocation = geoLocation, + startDate = startDate, + endDate = endDate, + locale = locale, + links = links + ) + + override fun getHeaders(): Headers = + Headers.build { + partnerTransactionId?.let { + append("Partner-Transaction-Id", it) + } + append("Accept", "application/vnd.exp-activity.v3+json") + } + + override fun getQueryParams(): Parameters = + Parameters.build { + location?.let { + append("location", it) + } + geoLocation?.let { + append("geoLocation", it) + } + startDate?.let { + append("startDate", it.toString()) + } + endDate?.let { + append("endDate", it.toString()) + } + locale?.let { + append("locale", it) + } + links?.let { + appendAll("links", toMultiValue(it.map { item -> item.value }, "csv")) + } + } + + override fun getPathParams(): Map = + buildMap { + } +} diff --git a/code/transformedSpecs.yaml b/code/transformedSpecs.yaml index 577a0d79..96baec46 100644 --- a/code/transformedSpecs.yaml +++ b/code/transformedSpecs.yaml @@ -38,6 +38,8 @@ tags: - name: Cars Listings - name: Cars Detail - name: download-url + - name: Activities List + - name: Activities Details paths: "/hotels/details/{offerToken}": get: @@ -2838,6 +2840,503 @@ paths: value: message: name resolution failed description: Service unavailable. + /activities/listings: + get: + tags: + - get-activity-listings + description: The Activities Search API allows partners to search for Expedia + Activity inventory. + operationId: get-activity-listings + parameters: + - name: location + in: query + description: >- + Can be a city name, street address, three-letter IATA Airport Code + or a landmark name. + + (If the value submitted does not clearly identify a single location the API may returne a disambiguation response that lists possible options) + schema: + type: string + example: shenzhen + - name: geoLocation + in: query + description: >- + The latitude and longitude values identifying the center point of a + search radius (circle). + + North latitude will be represented by a positive value. South latitude by a negative value. + + East longitude will be represented by a positive value. West longitude by a negative value. + + The latitude and longitude values are joined together with a comma (,) character. + schema: + type: string + example: 25.070062,-121.538306 + - name: startDate + in: query + description: |- + Start date for the activity window in YYY-MM-DD format. + If an endDate value is supplied there must also be a startDate. + default: currentDate + schema: + type: string + format: date + example: 2021-10-01T00:00:00.000Z + - name: endDate + in: query + description: |- + End date for the activity window in YYY-MM-DD format. + default: "startDate+14" + schema: + type: string + format: date + example: 2021-10-10T00:00:00.000Z + - name: locale + in: query + description: >- + locale is composed of language identifier and region identifier, + connected by "_" that specifies the language in which the response + will be returned. + + example: "fr_FR" refers to French as spoken in France, while "fr_CA" refers to French as spoken in Canada. + + For a full list of supported locales please refer to the link at the bottom of the page. + schema: + type: string + example: en_US + - name: links + in: query + description: >- + Comma-separated list to specify the types of HATEAOS links returned + in the API Response. + + WD (deep link URL to web infosite) + + AD (details API query) + explode: false + schema: + type: array + items: + type: string + enum: + - WD + - AD + example: WD + - name: Partner-Transaction-Id + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: BestTravel-123456-798101112 + responses: + "200": + description: successful + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: "#/components/schemas/ActivityListingsResponse" + example: + TransactionId: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + Count: 1 + Location: shenzhen, gd + StartDate: 2021-08-01T00:00:00.000Z + EndDate: 2021-08-08T00:00:00.000Z + Categories: + - Count: 1 + CategoryName: Cruises & Water Tours + CategoryDisplayName: Cruises & Water Tours + GroupName: Tours + GroupDisplayName: Tours + Activities: + - Id: 166597 + Title: "Faster Than Skip-the-Line: Vatican, Sistine Chapel & St. Peter's Tour" + Description: Enjoy 5 of Seattle's most popular attractions with a multi-ticket + booklet that’s valid for 9 consecutive days. This pass is + perfect if you want to explore the city on your schedule, + craft your own itinerary, and visit the city’s can’t-miss + museums and most iconi.. + Media: + - Type: "1" + Size: t + Url: http://a.travel-assets.com/ lxweb/ media-vault/ 166597_m.jpeg? v=104741 + Categories: + - Walking & Bike Tours + Duration: PT3H0M + CancellationPolicy: + FreeCancellation: true + Price: + Category: Adult + TotalRate: + Value: 100 + Currency: USD + ReferencePrice: + Category: Adult + TotalRate: + Value: 110 + Currency: USD + Savings: + percentage: 42 + amount: + Value: "9" + Currency: USD + Redemption: + Type: Voucherless + Locations: + - Address: + Address1: 99 Union St + City: Seattle + PostalCode: "431625" + Province: WA + Country: USA + GeoLocation: + Latitude: "47.60772" + Longitude: -122.33936 + Locations: + - Address: + Address1: 99 Union St + City: Seattle + PostalCode: "431625" + Province: WA + Country: USA + GeoLocation: + Latitude: "47.60772" + Longitude: -122.33936 + Supplier: + Name: City Wonders + RecommendationScore: 90 + ReviewCount: 100 + Links: + WebDetails: + Href: https://www.expedia.com/things-to-do/space-needle-observation-deck-admission.a193678.activity-details?srp=true&location=sea + ApiDetails: + Accept: application/vnd.exp-activity.v3+json + Method: GET + Href: https://apim.expedia.com/activities/details/CgUyMDIzMBIyCgkyMDEzMDQ1OTYSCTIwOTc3MjcwOBoCMjQqCjIwMTctMTEtMTkyCjIwMTctMTEtMjUqAwoBMg + "400": + description: >- + Client side error while providing the request i.e bad / invalid + input parameters. The server responds back with " + + "this Http response code and with the appropriate JSON error response. + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: "#/components/schemas/ActivitiesErrors" + example: + Errors: + - Code: AMBIGUOUS_LOCATION + Description: Multiple search locations found. + LocationKeyword: 99UnionSt + LocationOptions: + - ShortName: Union Grove, Wisconsin, United States of America + Address: Milwaukee (and vicinity), Wisconsin, United States of America + RequestedLocation: United States + Locations: + - Name: Portland (and vicinity) + LocationId: seat001 + TransactionId: cecf62c8-c103-4181-b09d-53c7190d1c48 + "401": + description: Unauthorized or Invalid authentication credentials + content: + application/json: + schema: + $ref: "#/components/schemas/APIMError" + examples: + unauthorized: + value: |- + { + "message": "Unauthorized" + } + Invalid authentication credentials: + value: |- + { + "message": "Invalid authentication credentials" + } + "403": + description: cannot consume this service + content: + application/json: + schema: + $ref: "#/components/schemas/APIMError" + examples: + cannot consume this service: + value: |- + { + "message": "You cannot consume this service" + } + "404": + description: No Route matched + content: + application/json: + schema: + $ref: "#/components/schemas/APIMError" + examples: + no Route matched: + value: |- + { + "message": "no Route matched with those values" + } + "429": + description: API rate limit exceeded + content: + application/json: + schema: + $ref: "#/components/schemas/APIMError" + examples: + API rate limit exceeded: + value: |- + { + "message": "API rate limit exceeded" + } + "500": + description: >- + Server side error i.e connection timeout while talking to downstream + services, downstream returned error. The server responds back with + this Http " + + "response code and with the appropriate JSON error response. + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: "#/components/schemas/ActivitiesErrors" + "503": + description: name resolution failed + content: + application/json: + schema: + $ref: "#/components/schemas/APIMError" + examples: + name resolution failed: + value: |- + { + "message": "name resolution failed" + } + "504": + description: upstream server is timing out + content: + text/plain: + examples: + upstream server is timing out: + value: The upstream server is timing out + security: + - basicSchema: [] + "/activities/details/{offerToken}": + get: + tags: + - get-activity-details + description: The Activity Details API provides detailed information about one + selected activity. + operationId: get-activity-details + parameters: + - name: offerToken + in: path + description: the offerToken of a activity + required: true + schema: + type: string + example: CgY0NzY2NzgSCjIwMjEtMDUtMDIaCjIwMjEtMDUtMDc + - name: locale + in: query + description: >- + locale is composed of language identifier and region identifier, + connected by "_" that specifies the language + + in which the response will be returned. + + example: "fr_FR" refers to French as spoken in France, while "fr_CA" refers to French as spoken in Canada. + + For a full list of supported locales please refer to the link at the bottom of the page. + schema: + type: string + example: en_US + - name: Partner-Transaction-Id + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: BestTravel-123456-798101112 + responses: + "200": + description: successful + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: "#/components/schemas/ActivityDetailsResponse" + example: + TransactionId: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + Count: 1 + Location: shenzhen, gd + StartDate: 2021-08-01T00:00:00.000Z + EndDate: 2021-08-08T00:00:00.000Z + Categories: + - Count: 1 + CategoryName: Cruises & Water Tours + CategoryDisplayName: Cruises & Water Tours + GroupName: Tours + GroupDisplayName: Tours + Activities: + - Id: 166597 + Title: "Faster Than Skip-the-Line: Vatican, Sistine Chapel & St. Peter's Tour" + Description: Enjoy 5 of Seattle's most popular attractions with a multi-ticket + booklet that’s valid for 9 consecutive days. This pass is + perfect if you want to explore the city on your schedule, + craft your own itinerary, and visit the city’s can’t-miss + museums and most iconi.. + Media: + - Type: "1" + Size: t + Url: http://a.travel-assets.com/ lxweb/ media-vault/ 166597_m.jpeg? v=104741 + Categories: + - Walking & Bike Tours + Duration: PT3H0M + CancellationPolicy: + FreeCancellation: true + Price: + Category: Adult + TotalRate: + Value: 100 + Currency: USD + ReferencePrice: + Category: Adult + TotalRate: + Value: 110 + Currency: USD + Savings: + percentage: 42 + amount: + Value: "9" + Currency: USD + Redemption: + Type: Voucherless + Locations: + - Address: + Address1: 99 Union St + City: Seattle + PostalCode: "431625" + Province: WA + Country: USA + GeoLocation: + Latitude: "47.60772" + Longitude: -122.33936 + Locations: + - Address: + Address1: 99 Union St + City: Seattle + PostalCode: "431625" + Province: WA + Country: USA + GeoLocation: + Latitude: "47.60772" + Longitude: -122.33936 + Supplier: + Name: City Wonders + RecommendationScore: 90 + ReviewCount: 100 + Links: + WebDetails: + Href: https://www.expedia.com/things-to-do/space-needle-observation-deck-admission.a193678.activity-details?srp=true&location=sea + ApiDetails: + Accept: application/vnd.exp-activity.v3+json + Method: GET + Href: https://apim.expedia.com/activities/details/CgUyMDIzMBIyCgkyMDEzMDQ1OTYSCTIwOTc3MjcwOBoCMjQqCjIwMTctMTEtMTkyCjIwMTctMTEtMjUqAwoBMg + "400": + description: >- + Client side error while providing the request i.e bad / invalid + input parameters. The server responds back with " + + "this Http response code and with the appropriate JSON error response. + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: "#/components/schemas/ActivitiesErrors" + example: + Errors: + - Code: INVALID_LINKS + Description: Invalid links. Allowed value are:[WS, AD, WD]. + TransactionId: 583b7277-772a-4802-8ac7-bcdf978abbdb + "401": + description: Unauthorized or Invalid authentication credentials + content: + application/json: + schema: + $ref: "#/components/schemas/APIMError" + examples: + unauthorized: + value: |- + { + "message": "Unauthorized" + } + Invalid authentication credentials: + value: |- + { + "message": "Invalid authentication credentials" + } + "403": + description: cannot consume this service + content: + application/json: + schema: + $ref: "#/components/schemas/APIMError" + examples: + cannot consume this service: + value: |- + { + "message": "You cannot consume this service" + } + "404": + description: No Route matched + content: + application/json: + schema: + $ref: "#/components/schemas/APIMError" + examples: + no Route matched: + value: |- + { + "message": "no Route matched with those values" + } + "429": + description: API rate limit exceeded + content: + application/json: + schema: + $ref: "#/components/schemas/APIMError" + examples: + API rate limit exceeded: + value: |- + { + "message": "API rate limit exceeded" + } + "500": + description: >- + Server side error i.e connection timeout while talking to downstream + services, downstream returned error. The server responds back with + this Http " + + "response code and with the appropriate JSON error response. + content: + application/vnd.exp-activity.v3+json: + schema: + $ref: "#/components/schemas/ActivitiesErrors" + "503": + description: name resolution failed + content: + application/json: + schema: + $ref: "#/components/schemas/APIMError" + examples: + name resolution failed: + value: |- + { + "message": "name resolution failed" + } + "504": + description: upstream server is timing out + content: + text/plain: + examples: + upstream server is timing out: + value: The upstream server is timing out + security: + - basicSchema: [] components: schemas: Address: @@ -7064,6 +7563,875 @@ components: message: type: string description: Error from the APIM. + ActivitiesMoney: + required: + - Currency + - Value + type: object + properties: + Value: + type: string + description: The value of the element being defined. + example: "21.9" + Currency: + type: string + description: The ISO 4217 Currency Code that the value is expressed in. + example: USD + LocalCurrencyPrice: + $ref: "#/components/schemas/ActivitiesMoney" + description: Container for the discount amount. + ActivitiesPrice: + required: + - TotalRate + type: object + properties: + Category: + type: string + description: |- + Type of passenger. + Values supported are: + ADULT | SENIOR | CHILD + example: ADULT + TotalRate: + $ref: "#/components/schemas/ActivitiesMoney" + TotalFees: + $ref: "#/components/schemas/ActivitiesMoney" + TotalTaxesAndFees: + $ref: "#/components/schemas/ActivitiesMoney" + ReferencePrice: + $ref: "#/components/schemas/ReferencePrice" + Savings: + $ref: "#/components/schemas/Savings" + description: The price of the offer + ReferencePrice: + required: + - TotalRate + type: object + properties: + TotalRate: + $ref: "#/components/schemas/ActivitiesMoney" + TotalFees: + $ref: "#/components/schemas/ActivitiesMoney" + TotalTaxesAndFees: + $ref: "#/components/schemas/ActivitiesMoney" + description: Container for the reference price used for strike out display. + Restrictions: + required: + - Max + - Min + - Type + type: object + properties: + Type: + type: string + description: Type of the Restriction. + example: AGE + Max: + type: string + description: Maximum value allowed for the restriction type. + example: "255" + Min: + type: string + description: Minimum value allowed for the restriction type. + example: "9" + Description: + type: string + description: The text to describe the restriction. + example: 9+ years + description: Container of the Restrictions associated to this ticket. + Savings: + required: + - Amount + - Percentage + type: object + properties: + Percentage: + type: integer + description: The percentage of the price that has been discounted off the + regular price for the current activity. + format: int32 + example: 10 + Amount: + $ref: "#/components/schemas/ActivitiesMoney" + description: Container of savings information. + Ticket: + required: + - Code + - Count + - Id + - TicketPrice + type: object + properties: + Id: + type: integer + description: The numerical identifier for the ticket. + format: int32 + example: 6429 + Code: + type: string + description: |- + The code for the ticket. + Values supported are: + Adult + Traveler + Child + Group + Senior + Infant + Student + example: Adult + Count: + type: integer + description: The number of each ticket type to be booked. + format: int32 + example: 1 + Restrictions: + $ref: "#/components/schemas/Restrictions" + TicketPrice: + $ref: "#/components/schemas/ActivitiesPrice" + description: The list of Ticket information. + ActivitiesAddress: + type: object + properties: + Address1: + type: string + description: Street Number, Street Name, or PO Box. + example: 724 Pine St + Address2: + type: string + description: Apartment, Floor, Suite, Bldg + example: Second Floor + Suite: + type: string + description: Suite/apartment number + example: "123" + City: + type: string + description: The city + example: New York + Province: + type: string + description: The state or province. + example: NY + Country: + type: string + description: 3-letter code for the country. + example: USA + PostalCode: + type: string + description: Zip/postal code. + example: "98004" + description: Address information + ActivitiesCountry: + required: + - IsoCode2 + - IsoCode3 + - Name + type: object + properties: + Name: + type: string + description: country name + example: Ireland + Code: + type: string + description: 3-letter code for the country + example: IRL + IsoCode2: + type: string + description: 2-letter code for the country + example: IE + IsoCode3: + type: string + description: 3-letter code for the country + example: IRL + description: Container for disambiguation country information + ActivitiesError: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Error code describing the issue + example: AMBIGUOUS_LOCATION + DetailCode: + type: string + description: Detailed error code describing the issue. + example: MULTIPLE_AMBIGUOUS_LOCATION + Description: + type: string + description: A simple description of what the error is. + example: "Multiple pickup locations found. " + LocationKeyword: + type: string + description: The requested location that caused the error. + example: "Portland. " + LocationOptions: + type: array + description: "List for possible locations from which the customer must choose + the best one to be re-submitted in the request. " + items: + $ref: "#/components/schemas/ActivitiesLocationOption" + description: Container for error list. + ActivitiesErrors: + required: + - Errors + - TransactionId + type: object + properties: + Errors: + type: array + description: Container for error list. + items: + $ref: "#/components/schemas/ActivitiesError" + TransactionId: + type: string + description: A unique identifier for the transaction. + example: a9e371c4-89d9-4f9c-8df7-df105830e7fe + xml: + name: ErrorResponse + ActivitiesGeoLocation: + required: + - Latitude + - Longitude + type: object + properties: + Latitude: + type: string + description: Latitude of the location. + example: "38.184978" + Longitude: + type: string + description: Longitude of the location. + example: "85.7412" + Obfuscated: + type: boolean + description: Geographic information + ActivitiesLocation: + type: object + properties: + Type: + type: string + description: The type of location code (MULTICITY | METROCODE). + example: MULTICITY + Id: + type: string + description: Expedia Region ID of the specified airport. + example: "6139103" + Name: + type: string + description: Location Name + example: Seattle-Tacoma International Airport + Code: + type: string + description: Location Code + example: SEA + LocationId: + type: string + description: Location id. + example: SEAT001 + Address: + $ref: "#/components/schemas/ActivitiesAddress" + PointOfInterest: + type: string + GeoLocation: + $ref: "#/components/schemas/ActivitiesGeoLocation" + Neighborhood: + $ref: "#/components/schemas/ActivitiesNeighborhood" + RegionId: + type: integer + description: RegionId the location resides in. + format: int64 + example: 6200275 + Country: + $ref: "#/components/schemas/ActivitiesCountry" + description: List of location(s) where the activity will happen. + ActivitiesLocationOption: + required: + - Locations + - RequestedLocation + type: object + properties: + RequestedLocation: + type: string + description: Location used in partner request. + example: Paris + Locations: + type: array + description: Container for list of possible locations that could be used to + disambiguate the query. + items: + $ref: "#/components/schemas/ActivitiesLocation" + Type: + type: string + description: Type of the location. + example: TRAINSTATION + RegionId: + type: string + description: RegionId the location resides in. + example: "6200275" + ShortName: + type: string + description: The name of the location which matches the location keyword. + example: Dublin Connolly Station + AirportCode: + type: string + description: Indicates the nearest major airport to the location. + example: DUB + Address: + type: string + description: The address of the location. + example: Dublin Connolly Station, Ireland + Country: + $ref: "#/components/schemas/ActivitiesCountry" + GeoLocation: + $ref: "#/components/schemas/ActivitiesGeoLocation" + description: "List for possible locations from which the customer must choose + the best one to be re-submitted in the request. " + ActivitiesNeighborhood: + required: + - Id + - Name + type: object + properties: + Id: + type: string + description: Neighborhood id. + example: "6160232" + Name: + type: string + description: Neighborhood name. + example: Le Pharo + description: Geography entities which are typically contained within a city. + This includes the categories neighborhood and point of interest. Low + level regions are not a formally defined concept in the geography model. + Activity: + required: + - Categories + - Description + - Duration + - FreeCancellation + - Id + - Media + - Price + - Supplier + - Title + type: object + properties: + Id: + type: integer + description: The numerical identifier for this particular activity + format: int32 + example: 166597 + Title: + type: string + description: The display title for this activity. + example: "Faster Than Skip-the-Line: Vatican, Sistine Chapel & St. Peter's Tour" + Description: + type: string + description: The description of the Activity. + example: Enjoy 5 of Seattle's most popular attractions with a multi-ticket + booklet that’s valid for 9 consecutive days. This pass is perfect if + you want to explore the city on your schedule, craft your own + itinerary, and visit the city’s can’t-miss museums and most iconi... + Media: + type: array + description: List of activity Media. + items: + $ref: "#/components/schemas/ActivitiesMedia" + Categories: + type: array + description: >- + A list of the Activity categories to which this particular activity + belongs. + + Possible values are: + + Adventures + + Air, Balloon & Helicopter Tours + + Attractions + + Cruises & Water Tours + + Day Trips & Excursions + + Food & Drink + + Hop-on Hop-off + + Multi-Day & Extended Tours + + Nightlife + + Private Tours + + Private Transfers + + Shared Transfers + + Show & Sport Tickets + + Sightseeing Passes + + Theme Parks + + Tours & Sightseeing + + Walking & Bike Tours + + Water Activities + + Wedding Ceremonies + + Winter Activities + example: + - Walking & Bike Tours + items: + type: string + description: A list of the Activity categories to which this particular activity + belongs. + example: Walking & Bike Tours + xml: + name: Categories + Duration: + type: string + description: |- + The anticipated time duration for the activity. + Using java jdk Duration parsing. + example: PT1H0M + FreeCancellation: + type: boolean + description: A boolean value describing whether or not this activity reservation + can be cancelled without incurring a penalty. + example: true + Price: + $ref: "#/components/schemas/ActivitiesPrice" + Redemption: + $ref: "#/components/schemas/Redemption" + ActivityLocations: + type: array + description: Container of location information where activity happens. + items: + $ref: "#/components/schemas/ActivitiesLocation" + Supplier: + $ref: "#/components/schemas/ActivitiesSupplier" + ReviewScore: + type: integer + description: The overall Expedia score for the activity. + format: int32 + example: 72 + ReviewCount: + type: integer + description: The number of Expedia reviews that went into the calculation of the + ReviewScore. + format: int32 + example: 19 + Links: + type: object + additionalProperties: + $ref: "#/components/schemas/ActivitiesLink" + description: HATEOAS links included in this response. + xml: + wrapped: true + CancellationPolicy: + $ref: "#/components/schemas/ActivitiesCancellationPolicy" + Highlights: + type: array + description: Web formatted statement of the Highlight(s) for the activity. + items: + type: string + description: Web formatted statement of the Highlight(s) for the activity. + xml: + name: Highlights + TermsAndConditions: + type: array + description: Terms and Conditions for the Activity. + items: + type: string + description: Terms and Conditions for the Activity. + xml: + name: TermsAndConditions + Inclusions: + type: array + description: Web formatted statement of what is included in the activity + items: + type: string + description: Web formatted statement of what is included in the activity + xml: + name: Inclusions + Exclusions: + type: array + description: Web formatted statement of what is NOT included in the activity + items: + type: string + description: Web formatted statement of what is NOT included in the activity + xml: + name: Exclusions + KnowBeforeYouBook: + type: array + description: Web formatted statement of things that a purchaser should be aware + of BEFORE they book this activity. + items: + type: string + description: Web formatted statement of things that a purchaser should be aware + of BEFORE they book this activity. + xml: + name: KnowBeforeYouBook + KnowBeforeYouGo: + type: array + description: Web formatted statement of things that a purchaser should be aware + of BEFORE they go to this activity. + items: + type: string + description: Web formatted statement of things that a purchaser should be aware + of BEFORE they go to this activity. + xml: + name: KnowBeforeYouGo + Offers: + type: array + description: Offers for the activity. + items: + $ref: "#/components/schemas/Offer" + description: Detailed information on the Activity. + AvailableTimeSlot: + required: + - AllDayActivity + - CancellationPolicy + - DateTime + - Tickets + type: object + properties: + DateTime: + type: string + description: The date and time when the activity happens. + format: date-time + AllDayActivity: + type: boolean + description: Indicates whether the activity is an all-day activity. + example: true + CancellationPolicy: + $ref: "#/components/schemas/ActivitiesCancellationPolicy" + Tickets: + type: array + description: Container for ticket information. + items: + $ref: "#/components/schemas/Ticket" + description: The list of available Time Slots for the activity. + ActivitiesCancellationPolicy: + required: + - FreeCancellation + type: object + properties: + FreeCancellation: + type: boolean + description: Indicates whether the activity can be canceled free of charge + within the cancellation window or not. + example: true + CancelPolicyDescription: + type: string + description: The description of Cancellation Policy. + example: 72 hours + FreeCancellationMinHours: + type: integer + description: The minimum number of hours before activity when the activity can + still be cancelled for free. + format: int32 + example: 72 + FreeCancellationEndDateTime: + type: string + description: The date and time after which the activity will not be able to be + cancelled for free, stated in the local time to where the activity + takes place. + format: date-time + description: Container for the Cancellation Policy information. + ActivitiesLink: + required: + - Href + type: object + properties: + Accept: + type: string + description: Accept header. + Method: + type: string + description: HTTP method to connect. + example: GET + Href: + type: string + description: HATEOAS URL to fetch details. + description: Container of HATEOAS URL's + ActivitiesMedia: + required: + - Size + - Type + - Url + type: object + properties: + Type: + type: string + description: |- + type of the media. So far there is only one option: + 1: Image + example: "1" + Title: + type: string + description: Image title + example: Guestroom + Size: + type: string + description: >- + Image size + + You can find a link to the complete list of Supported Images Sizes in the Related Links section at the bottom of the page. + example: t + Url: + type: string + description: Image URL + example: https://images.trvl-media.com/hotels/1000000/30000/20300/20230/20230_159_t.jpg + description: List of activity Media. + Offer: + required: + - AvailableTimeSlots + - Duration + - Id + - OfferPrice + - Title + type: object + properties: + Id: + type: integer + description: The numerical identifier for the offer. + format: int32 + example: 166597 + Title: + type: string + description: A descriptive title for this offer. + example: 8:30 AM, Tour in English + Description: + type: string + description: Description of this offer. + Duration: + type: string + description: The anticipated time duration for the activity, e xpressed using + Java JDK duration format. + AvailableTimeSlots: + type: array + description: The list of available Time Slots for the activity. + items: + $ref: "#/components/schemas/AvailableTimeSlot" + OfferPrice: + $ref: "#/components/schemas/ActivitiesPrice" + Links: + type: object + additionalProperties: + $ref: "#/components/schemas/ActivitiesLink" + description: Container of HATEOAS URL's + xml: + wrapped: true + description: Offers for the activity. + ActivitiesPhone: + required: + - CountryCode + - Number + type: object + properties: + CountryCode: + type: string + description: Country code of traveler's phone number; only digits allowed. + example: "1" + AreaCode: + type: string + description: Area code of traveler's phone number; only digits allowed. + example: "614" + Number: + type: string + description: Traveler's phone number; only digits allowed. + example: "9288472" + ExtensionNumber: + type: string + description: The phone of the company providing the activity. + Redemption: + type: object + properties: + Type: + type: string + description: The type of redemption process associated to the activity. + example: Voucherless + RedemptionLocations: + type: array + description: List of redemption locations where the activity will take place, + please refer to Location Section below. + items: + $ref: "#/components/schemas/ActivitiesLocation" + description: Container of redemption information. + ActivitiesSupplier: + required: + - Name + type: object + properties: + Name: + type: string + description: The name of the company providing the activity. + example: City Wonders + Phone: + $ref: "#/components/schemas/ActivitiesPhone" + description: The details information of company providing the activity. + ActivitiesWarning: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Standardized warning code. + example: INVALID_CORPORATE_DISCOUNT_CODE + Description: + type: string + description: Standardized warning description message. + example: The Corporate DiscountCode '811490' is unavailable, but we found other + rates for you. + OriginalPrice: + $ref: "#/components/schemas/ActivitiesMoney" + NewPrice: + $ref: "#/components/schemas/ActivitiesMoney" + ChangedAmount: + $ref: "#/components/schemas/ActivitiesMoney" + ChangedPercentage: + type: string + description: |- + The changed percentage. + In the sample 2.97 means the changed percentage is 2.97%. + example: "2.97" + Links: + type: object + additionalProperties: + $ref: "#/components/schemas/ActivitiesLink" + xml: + wrapped: true + description: Container for all warnings generated during the transaction. + ActivityListingsResponse: + required: + - Count + - Location + - TransactionId + type: object + properties: + Warnings: + type: array + description: Container for all warnings generated during the transaction. + items: + $ref: "#/components/schemas/ActivitiesWarning" + TransactionId: + type: string + description: A unique identifier for this transaction. + example: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + Count: + type: integer + description: The number of activities returned in the response. + format: int64 + example: 100 + Location: + type: string + description: The location that the user searched, expressed in the exact format + that the inventory system uses to designate the location. + example: shenzhen, dg + StartDate: + type: string + description: The startDate of the returned group of activities in YYYY-MM-DD + format. + format: date + example: 2021-08-01T00:00:00.000Z + EndDate: + type: string + description: The endDate of returned group of activities in YYYY-MM-DD format. + format: date + example: 2021-08-10T00:00:00.000Z + Activities: + type: array + description: List of activities matching the search criteria. + items: + $ref: "#/components/schemas/Activity" + Categories: + type: array + description: Container for a breakdown of how many of each type of Activity have + been returned in the API response. + items: + $ref: "#/components/schemas/CategoryGroup" + CategoryGroup: + required: + - CategoryName + - Count + - GroupDisplayName + - GroupName + type: object + properties: + Count: + type: integer + description: The count of the number of categories the returned set of + activities map to. + format: int32 + example: 10 + GroupName: + type: string + description: |- + The group which the category belongs + Possible value is: + Recommendations + Tours + Activities + Transportation + Promotions + Duration + example: Tours + GroupDisplayName: + type: string + description: The localized value for category name. + example: Wander- und Fahrradtouren + CategoryName: + type: string + description: The name of one of the categories. + example: Walking & Bike Tours + CategoryDisplayName: + type: string + description: Container for a breakdown of how many of each type of Activity have + been returned in the API response. + ActivityDetailsResponse: + required: + - Location + - TransactionId + type: object + properties: + Warnings: + type: array + description: Container for all warnings generated during the transaction. + items: + $ref: "#/components/schemas/ActivitiesWarning" + TransactionId: + type: string + description: A unique identifier for this transaction. + example: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + Location: + type: string + description: The location user searched, translated into the full, unambiguous + format. + example: shenzhen, dg + StartDate: + type: string + description: The startDate of activities in YYY-MM-DD format. + format: date + example: 2021-08-01T00:00:00.000Z + EndDate: + type: string + description: The endDate of activities in YYY-MM-DD format. + format: date + example: 2021-08-01T00:00:00.000Z + ActivityDetails: + $ref: "#/components/schemas/Activity" securitySchemes: Authorization: type: http From 9c43d3565689497df986d5af528c779973799927 Mon Sep 17 00:00:00 2001 From: Nasser Anssari Date: Wed, 22 Jan 2025 11:18:24 +0300 Subject: [PATCH 05/16] chore: update dependabot config (#52) --- .github/dependabot.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 76426704..80446cd3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,6 @@ # dependabot configuration available at: https://docs.github.com/en/code-security/dependabot version: 2 updates: - - package-ecosystem: "github-actions" directory: "/" schedule: @@ -15,7 +14,9 @@ updates: - Dependabot - package-ecosystem: maven - directory: "/code" + directories: + - "/examples" + - "/tests/integration" schedule: interval: daily time: "11:30" From 7b15648822a5af7a9b345ab6960043aa64907a95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 11:59:29 +0300 Subject: [PATCH 06/16] chore(deps): bump org.apache.logging.log4j:log4j-api from 2.23.1 to 2.24.3 in /examples (#54) --- examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pom.xml b/examples/pom.xml index 5599d42b..29dfa7f3 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -57,7 +57,7 @@ org.apache.logging.log4j log4j-api - 2.23.1 + 2.24.3 From 1f4c2a4d634340147c1c597326a76a0bd00a6c30 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:13:42 +0300 Subject: [PATCH 07/16] chore(deps): bump org.apache.logging.log4j:log4j-slf4j2-impl from 2.23.1 to 2.24.3 in /examples (#55) --- examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pom.xml b/examples/pom.xml index 29dfa7f3..7b303439 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -63,7 +63,7 @@ org.apache.logging.log4j log4j-slf4j2-impl - 2.23.1 + 2.24.3 From 79a5a2d4756f19b9d1c6b9e95559df56b25297f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:14:09 +0300 Subject: [PATCH 08/16] chore(deps): bump com.fasterxml.jackson.core:jackson-databind from 2.18.1 to 2.18.2 in /examples (#56) --- examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pom.xml b/examples/pom.xml index 7b303439..455b2f8b 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -69,7 +69,7 @@ com.fasterxml.jackson.core jackson-databind - 2.18.1 + 2.18.2 From 32def15c9b9c1b93657b206698b8d97391d817fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:14:55 +0300 Subject: [PATCH 09/16] chore(deps): bump org.apache.maven.plugins:maven-surefire-report-plugin from 3.5.0 to 3.5.2 in /tests/integration (#60) --- tests/integration/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml index 7eaf30a2..d02a834d 100644 --- a/tests/integration/pom.xml +++ b/tests/integration/pom.xml @@ -104,7 +104,7 @@ org.apache.maven.plugins maven-surefire-report-plugin - 3.5.0 + 3.5.2 report From 195ee43068ce7433307ce2d3b0e7ba752dbb4375 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:15:33 +0300 Subject: [PATCH 10/16] chore(deps): bump org.apache.maven.plugins:maven-checkstyle-plugin from 3.5.0 to 3.6.0 in /tests/integration (#61) --- tests/integration/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml index d02a834d..dd860475 100644 --- a/tests/integration/pom.xml +++ b/tests/integration/pom.xml @@ -67,7 +67,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.5.0 + 3.6.0 google_checks.xml true From 15a3a0dfb57829a1bb00638906fec05f14da72f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:16:00 +0300 Subject: [PATCH 11/16] chore(deps): bump com.expediagroup:xap-sdk from 1.0.0 to 1.1.0 in /examples (#57) --- examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pom.xml b/examples/pom.xml index 455b2f8b..6c1fa707 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -31,7 +31,7 @@ 1.8 1.8 UTF-8 - 1.0.0 + 1.1.0 From 9ef0c202b270fe410cc41dbe2693340c9d6c5c80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:16:30 +0300 Subject: [PATCH 12/16] chore(deps): bump org.apache.maven.plugins:maven-checkstyle-plugin from 3.5.0 to 3.6.0 in /examples (#58) --- examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pom.xml b/examples/pom.xml index 6c1fa707..0c8e4d50 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -78,7 +78,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.5.0 + 3.6.0 google_checks.xml true From fa2a58db240f7127323f28518bea3f81de944d93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:17:04 +0300 Subject: [PATCH 13/16] chore(deps): bump com.expediagroup:xap-sdk from 0.0.17-SNAPSHOT to 1.1.0 in /tests/integration (#59) --- tests/integration/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml index dd860475..9f02da1a 100644 --- a/tests/integration/pom.xml +++ b/tests/integration/pom.xml @@ -13,7 +13,7 @@ 1.8 1.8 UTF-8 - 0.0.17-SNAPSHOT + 1.1.0 From 982e4d9d0b451449979a71d943266e1f7825864c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:20:19 +0300 Subject: [PATCH 14/16] chore(deps): bump org.apache.logging.log4j:log4j-api from 2.23.1 to 2.24.3 in /tests/integration (#62) --- tests/integration/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml index 9f02da1a..57479fd9 100644 --- a/tests/integration/pom.xml +++ b/tests/integration/pom.xml @@ -39,7 +39,7 @@ org.apache.logging.log4j log4j-api - 2.23.1 + 2.24.3 From ba4103c18b008861dcbab46858543b3fc2fea5cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:22:05 +0300 Subject: [PATCH 15/16] chore(deps): bump org.apache.logging.log4j:log4j-slf4j2-impl from 2.23.1 to 2.24.3 in /tests/integration (#63) --- tests/integration/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml index 57479fd9..7f97c1f5 100644 --- a/tests/integration/pom.xml +++ b/tests/integration/pom.xml @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j2-impl - 2.23.1 + 2.24.3 From 6dbfc000d4f1591ed9515b5233f8198f6ceadde3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:14:37 +0300 Subject: [PATCH 16/16] chore(deps-dev): bump org.junit.jupiter:junit-jupiter from 5.11.3 to 5.11.4 in /tests/integration (#65) --- tests/integration/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml index 7f97c1f5..d5d79a9e 100644 --- a/tests/integration/pom.xml +++ b/tests/integration/pom.xml @@ -51,7 +51,7 @@ org.junit.jupiter junit-jupiter - 5.11.3 + 5.11.4 test